If research paid above starvation wages I'd do it.
But crud pays 10x as much as working on the latest particle accelerator and I can plan more than 1 year in the future.
"Catherine Rampell found that in 2006, just before the financial crisis, 25% of graduating seniors at Harvard University, 24% at Yale, and a whopping 46% at Princeton were starting their careers in financial services."
in https://www.project-syndicate.org/commentary/the-rent-seekin...
It turns out that the market believes that building CRUD apps is more valuable and useful to society than whatever it is physics researchers do.
You are right that we don't have a Stem shortage. Instead we have a Technology shortage, and way too many people are going into these other fields that aren't actually very useful.
on the other hand, more and more are learning programming these days, I recall after 2008(or 2000) some CS departments lost nearly 50% enrollment because coding jobs were saturated then, that may happen again.
still, the "safe" way will be good at coding while specializing in some STEM fields(including chip design, which is mostly software tool usage these days). Wall street is another way out, but I don't like it and won't recommend it to kids.