I think that the concept of "Capitalism going wrong" is silly and ahistorical.
Capital and capitalists ("capitalism" was initially not the focus) is a concept which appeared in the last 17th century with the Dutch East India Company, and became a lot more prominent in the 19th century with the Industrial revolution.
Capitalism is not market economy, mercantilism or the accumulation of money (all of that was already a thing during feudal economies, and before the industrial revolution)...
Capitalism is about the means of production, their ownership, the profits (or plundering of resources, in a colonial context), the sharing thereof.
It has *always* been uneven, and unpleasant if you're not in the class which actually has ownership of the means of production.
"Maximal benefit for as many people as possible" is not a goal that the people who hoarded the means of production (people who hoarded capital) ever had in mind. I understand that you didn't explicitly say it, but it's still implied in what you wrote. Maybe the implications is that capitalism fortuitously happened to encourage that "maximal benefit", but even that is misleading: what actually happened is that whenever you have a "blue ocean" to move to, whenever the market is expanding and growing (by the introduction of new productive technologies or the growth of population), there are more spoils that can be shared and enjoyed more widely across the population.
But the rate of profit tends to fall, there are fewer profits to share, and unless encouraged by the point of a bayonet, those who own capital don't have any reason to divest themselves to share more of it with society.
A sibling comment ( https://news.ycombinator.com/item?id=48871234 ) already hinted at the fact that it depends a lot on which group and at which time is benefitting...
One obvious example, are the exploited people during colonialism: despite benefit from spoils being abundant in the west, one shouldn't expect that the colonies' benefit was ever a priority.
Another example is you suggesting
somewhere in the late 1990s
A lot of the profits that you've witnessed in the west, are due to the markets of the former socialist republics opening up to western exploitation. Depending on the kind of investments or economic assistance that had been provided, some countries fared better than others... No one would've claimed that capitalism brought benefits for the many in the late 1990s in Russia, for example.