But what is the purpose of the market? Some arcane, abstract, paperclip-machine-esque efficiency?
Or rather a short-term optimizer for labour and investments to get people to produce goods and provide services that are in demand and thus keep the lights on and society running?
Because in the latter case, someone providing me with nice chocolate cookies is a feature, not a bug. The system is (somewhat) working, the market is providing me chocolate cookies with reasonable efficiency [1].
[1]: plus some rainforest destruction, but that's another issue that I personally don't believe market economy or, more specifically, capitalism is capable of solving, but this is getting off topic