Lootboxes are legalized gambling for minors. So yeah, no shit it works. Just because a thing is profitable doesn't make it good. The opioid epidemic proved very profitable, but just like gambling for kids, doesn't make it a thing we should accept or want for our society.
Well, theres "working" and theres "working well". Capitalism is not working so well anymore and its likely going to work worse as time goes on. more things will become automated, wealth inequality (and therefore a gap in political power) will grow, and companies will keep expecting increased growth in a world of limited(and in some cases, decreasing) resources. Capitalism currently "works" in the sense that its making resources move around, but thats about all its doing for regular, non rich, non well off people(and often is not doing even that much for them). It's simply not sustainable when unregulated, thats why we need a well regulated economy.