I do think planned economies generally fail though - capitalism (meaning the process of letting individual agents decide on resource allocation) is a very powerful tool for optimizing something, and trying to centralize that decision making requires way more processing power. There’s just a huge amount of parallelizability here that you miss out on by having the government try to do allocation.
Don’t take this as me saying unregulated capitalism works even a little bit, you definitely need someone in charge of operating that tool or you end up in our current mess.