China even more so. For much of history, China has been the richest country on earth! Not just total, but even per capita! Ya, the late Qing and republic eras were a mess, but that China would prosper after a period of decline has happened before and isn't surprising. Mao's Great Leap Forward and cultural revolution probably hurt more than helped, and China is mostly where it is today inspite of the communists. It's all about the people.
Germany and Japan were both developed before they were devestated, and knew collectively how to develop again; it wasn't a miracle in any case. Leading countries tend to lead even when knocked back with setbacks. What is perhaps a miracle was Germany breaking away from its Holy Roman Empire roots in the first place, or Japan modernizing in the mid 19th century (incidentally, this happened at the same time). Once you make that "step", you are likely not to fall backwards.
Communism is bad for innovation for two major, connected, reasons. First, there is very little, if any, competition. Most innovation comes from trying to beat the other guy and there just isn't any competition in a system that wants the state to run everything. Second, entrepreneur's are non-existent because there is no way for them to make money off of their inventions outside of cozying up with the State.
Also, your point about them moving from a medieval society to a modern one is ironic considering the USSR's pathetic technology. Outside of military applications they were failing in almost every single way. Just read some stories about the East Germans trying to flee to West Germany or the USSR's Olympic team visiting the US and thinking that our grocery stores were fake because of all of the food.
If they didn't then they wouldn't have been able to keep up for such a long time and Russia today couldn't be such a big geopolitical adversary to this day.
If they had not implemented Communism after WWI I believe they could have been a second US.
Soviet Union: Yes they industrialised at an astonishing rate, but they did this only for a single purpose: war. Even after the second world war the only area in which they could keep up with the West consistently was the military complex. And in the end the system failed although Soviet leaders were smart enough to let it implode in a way that didn't create civil war at a grand scale.
Yugoslavia: Socialism failed, ended in a nasty civil war.
Cuba: Technologically backwards, people live there like we did a 100 years ago.
North Korea: They have such a poor and malnourished population that today a North Korean is on average significantly smaller than a South Korean. Yet they maintain a massive military.
Venezuela: A oil rich (one of the largest oil reserves in the world!) country with internal and external peace and fertile lands was turned by Socialism into a starving country. Venezuelans today literally hunt animals like dogs and cats on the streets so they don't starve. Absolute madness.
China: Communist policies under Mao led to 30-40 Millions of Chinese starving to death when he collectivised the land. Later the Chinese turned their internal system around to something that resembles more a wild west capitalism with a sprinkle of Meritocracy and only then Chinese saw significant improvements in their lives.
Nazi Germany: This is controversial today as many claim that they weren't really Socialist. My opinion is that it was although it had a private sector. Still all economic activity was under 100% control of the government and all they produced went either to their massive social system or towards war. A rough translation of the Nazi parties name is "National Socialist German Workers Party". I believe that Socialist reject the Socialist nature of the Nazis because it embarrasses them.
To my knowledge there is not a single example of a Communist society that worked. But besides the economy there is a disturbing similarity between all societies that tried Socialism: Concentration Camps and Authoritarianism.
They needed this because there's always too much resistance to the Socialist System in every society that tried it. (people want to be free) In Socialist societies you need to police the thought of everyone and send them to correction camps if they resist because otherwise it would implode.
In 40 years, the Soviet Union went from a medieval-like society with 95% of the people being peasants working their lords' lands, to inventing LEDs, grid-scale nuclear power, orbital launches, artificial satellites, manned space flight, commercial supersonic flight, seminal work in transplantation and artificial organs, etc. It became the second world superpower in science and innovation, which by the way, it no longer isn't after the fall of communism.
It was pretty much an economic miracle, like the so-called "German miracle" and "Japanese miracle", although of course most current thinkers won't recognize it because Communism is Bad(tm) and it seems we can only think in black and white (as the Soviet Union had an autochratic and murderous regime, apparently we can't say what they did right).
So I don't think the statement that communism is bad for innovation holds water historically. It's bad for other things, but not necessarily for innovation.