Markets will make you climb a hill ignoring it ends on a cliff end
Not only are many individual agents aligned with short term interests they often either can't because they will be pushed out by short term thinkers or literally benefit from net harm to all. America mostly being composed of the rich not the masses voting with their wallets.
This is the same market (or set of markets) that have lifted billions of people out of poverty. If you're arguing central planning does better then I'd love to see some evidence of it, but to my mind the fact that so many companies can coordinate, even across language barriers and legal systems, sometimes hundreds or thousands cooperating to make products, is incredible, and is not going to be beaten by any other system.
At least on average - of course an authoritarian country like the USSR can drag value out of its citizens by force and spend it on the space race, but that kills people and even, in that case, the country itself.
Far better to have cooperation and value exchange based on the demand generated by real people.
The problem is it's an optimizing function for the rich getting richer, not for the good of society, not for reducing human suffering, not even, y'know, the survival of the human race.
Some people get rich, on average by merit. And everyone gets the products they want at a low price. Can you imagine if the only cars available were made in the USSR, like Ladas? They were terrible because there was no capitalism, and so no competition. But if you'd rather have abysmal cars but know that no one got rich making them, I guess that's...a choice?
Like the Sacklers who got rich by... providing the best opiates. Or Zuck, who got rich by... destroying the fabric of our society. Or Big Oil, which got rich by... destroying ecosystems and dooming us all. Or United Fruit Company which got rich by... brutally colonizing Latin America.
It's almost as if the profit motive optimized for profit, not any other outcome that was in any way beneficial to anyone but the ones... profiting.
This proves that the market does not inherently work magic.