In the Netherlands we have a lot of outsourcing to India and a lot of Indian IT workers moving here. We still have many IT job openings and some companies have been moving development back from India, because cultural differences and language barriers some times cost more than the added salary of a local employee.
> People in 3rd world countries no longer want to pursue career as a doctor (and other similarly needed professions like law) (expensive, time consuming, etc) and just pursue SWE jobs
This assumes that people pursue career paths only for the money. Of the doctors I know, most people did not pick that job for the money, they did it because they wanted to be a doctor.
Then there's the fact that people have different interests and natural skill sets. A family member of mine, for example, is a doctor and asked me: "do you really like computers". She would not become an SWE even if it paid double.