This is exactly the issue, but the solution will not be easy. Over the past 25 years some careers have become exponentially more lucrative, with much less risk, than other careers, even though they require and use the same skill set. A data scientist working for a big tech company is making gobs more than a botany post-doc, even though their skills and required education are similar.
Back 25-30 years ago, the chasm in pay wasn't as wide, and that was because pre-Internet (or pre-widely utilized Internet I should say), software just wasn't as lucrative. Now, though, I think you're seeing lots of challenges hiring in many professions because tech has become so monstrously dominant. You can say "just pay these folks more", but the money has to come from somewhere, and when big tech can easily afford 300k plus salaries for a position where other industries can't afford half that, it's difficult to see how this will improve.
It's not just a matter of salaries and funding, the economic environment has changed a lot in the few decades. Individual incomes don't go as far as they used to, inflation is through the roof. Even the high paying jobs are suffering, they just have further to fall. The jobs that were on the margin (like Botany probably) have been pushed over the economic cliff and are no longer viable given the cost of entry.
We need a fundamental reassessment of science funding and our economic priorities, sadly I imagine things will have to get a lot worse before that conversation happens, and frankly the people who got us into this mess have to leave office/die off, as a class they've proven unwilling/unable to adapt to uncomfortable realities.
Alternately, consider the 1970's US oversupply of physics phds, with associated "near collapse" of graduate programs. With a risk and pay gap - "Q: How can I talk with a physics PhD? A: Hail a cab."
Programs and market restructured, with more flow into industry. But retargetability of science PhDs to match market need remains a challenge. And today, science programs depend on tech absorbing lots of graduates. With acceptable career opportunity cost, both absolute and relative to other education paths. So what happens if/when tech no longer provides that opportunity? No longer mitigates oversupply back-pressure? Especially with teaching career paths collapsing.
The 1970's oversupply shakeup did some good. Perhaps another might too - perhaps science education might finally get the intensive focus needed to become less of a disaster. But...
> some careers have become exponentially more lucrative, with much less risk, than other careers, even though they require and use the same skill set.
Absent which, studying the sciences might become far less viable, rather than more. Tech is currently allowing society to avoid a great deal of "have a degree, can't find work" difficulty.
Back 25-30 years ago, the chasm in pay wasn't as wide, and that was because pre-Internet (or pre-widely utilized Internet I should say), software just wasn't as lucrative. Now, though, I think you're seeing lots of challenges hiring in many professions because tech has become so monstrously dominant. You can say "just pay these folks more", but the money has to come from somewhere, and when big tech can easily afford 300k plus salaries for a position where other industries can't afford half that, it's difficult to see how this will improve.