There was some emergent property of the communist countries, compared to the capitalist ones, that made them want to produce large numbers of highly educated professionals in specific fields, the Eastern bloc with engineers as well as Cuba with doctors. I suspect there are many factors but it should be considered that licensing boards prioritize career safety for existing professionals.
Cuba proliferates their doctors because they've massively contracted them out as exports to bring in foreign exchange money. Sometimes they donate care when it's politically expedient.