Prices and financial markets in general exist solely for information transmission. The central problem of economics is "How do you produce the things that your population needs, in the quantity and at the time they need them, as efficiently as possible?" This is why every centrally-planned economy eventually fails, and why we were stuck in the feudal middle ages for a millennia. Information (and incentives) about what to produce and how to produce it efficiently weren't getting to the population at large, which caught us in a local subsistence minima. Financial markets give all the players an incentive (in the form of profit) to transmit information (in the form of prices) from people who want goods to people who can supply them.
This is also behind the theory of why certain forms of financial transactions are legal and others are illegal. Arbitrage = legal, because it converges prices in two separate markets in a way that gives producers in both those markets better information about true demand. Futures markets = legal, because they smooth out temporal fluctuations in demand so that producers only have to worry about producing, while also incentivizing the construction of just enough storage & buffering to hold that product. Pump & dump schemes = illegal, because they distort price information in the market in an unsustainable way and then leave later participants to bear the cost of this. Same with Ponzi schemes. Equities markets = legal, because they transmit information about the overall cost of capital within the economy to firms, which can then use it to decide the profitability or unprofitability of various investments.
Certainly one function of financial markets and prices is to convey information, but that's not "solely" their purpose. They also provide a mechanism for resource allocation, risk management, wealth generation and collective action, among other things.
Your point about centrally planned economies, while historically corroborated in cases like the Soviet Union, might be an overgeneralization. The effectiveness of an economic system depends on numerous factors, including its degree of flexibility, the effectiveness of its institutions, and its ability to adapt to changing circumstances.
Not all centrally planned economies are doomed to failure; some have been quite successful, notably in East Asia where countries like China and Vietnam have managed a mixed economy with elements of central planning and market mechanisms.
Many capitalist corporations are centrally planned economies larger than many nation states. While everything fails eventually, these centrally planned organizations can last multiple human generations, and can be more durable than many markets and market-oriented economies.
The assertion about the feudal Middle Ages also needs some nuance. The Middle Ages, and the feudal system in particular, had complexities beyond simple information and incentive problems. Numerous sociopolitical factors were at play, including a rigid class structure, the influence of the Church, and the lack of certain technological innovations. Ascribing the issues of a historical period mainly to its economic structure oversimplifies the multitude of factors that influenced societal development.
Moreover, while financial markets do help in transmitting information from consumers to producers, they are not infallible. They can, and often do, suffer from issues like information asymmetry, where one party in a transaction has more or better information than the other. This can lead to problems like adverse selection and moral hazard. Financial markets can also be subject to speculation, which can distort the "signal" provided by prices.
The focus on profit as the sole incentive in the market might be somewhat limited. People's decisions to buy, sell, and produce are influenced by a host of factors beyond profit, including societal and environmental concerns, personal values, and ethical considerations. Financial systems, to be truly effective, need to take into account this wide range of motivations.
Resource allocation, risk management, and collective action are all information transmission problems. It's arguable whether wealth is being generated by the people who actually do the work or the people who decide what work is being done, but that's the subject of this thread.
China isn't really centrally planned. They call themselves that so that the government and previous communist ideology can avoid losing face, but anyone who's visited there or done business with Chinese companies will say that it's intensely capitalistic, just with the potential for random state interference at a whim. I suspect the same is true for Vietnam, but know less about the country.
Information asymmetry issues are exactly why certain types of financial transactions are illegal - that's why we have things like SEC disclosure and insider trading laws.
This is also behind the theory of why certain forms of financial transactions are legal and others are illegal. Arbitrage = legal, because it converges prices in two separate markets in a way that gives producers in both those markets better information about true demand. Futures markets = legal, because they smooth out temporal fluctuations in demand so that producers only have to worry about producing, while also incentivizing the construction of just enough storage & buffering to hold that product. Pump & dump schemes = illegal, because they distort price information in the market in an unsustainable way and then leave later participants to bear the cost of this. Same with Ponzi schemes. Equities markets = legal, because they transmit information about the overall cost of capital within the economy to firms, which can then use it to decide the profitability or unprofitability of various investments.