Speaking from one of the formerly rich countries (UK), we treat our doctors and teachers incredibly shabbily - long hours, low pay, terrible conditions. It's frankly a miracle that anyone over the last 15 years has gone into either profession.
Fix the low pay and terrible conditions and yeah, you'll easily produce enough doctors and teachers, but late-stage capitalism isn't going to do that...