1. Over what time frame? Med school takes 4 years and Residency takes 4+. JDs+bar take a few years and earnings take some time to ramp up. PhDs take half a decade (Even if we don't need more faculty, we do have a shortage of PhD supply in industry for fields like CS, Chem E, Biotech-ad, etc. and the median salary for those graduates is quite high with unemployment basically as low as you can go.)
2. Even without graduate education requirements, other fields have loooong ramp-up times but eventually end up doing well.
3. There are also jobs that are extremely valuable to society despite the expense of education (nursing comes to mind, as does teaching).
4. We would end up with stupid boom-bust cycles in labor supply and demand, even worse than what we have now. Reducing labor supply by making loans unavailable increases labor prices eventually, which eventually results in loans becoming available, which saturates supply, and then repeat the cycle every couple decades. Constant idiotic predicable crises. Welcome to myopic financial capitalism, where trust fund kids who never needed to pass their delay differential equations unit have all the power.
So to make this work you need some form of central planning of supply and demand -- by DECADES at a time. Who knew we'd need so many Python programmers in 1980 or even 2000? Which, if that predictive function works, why the FUCK are we using markets anyway?! Cut out the middle man if central planning works. (It doesn't.)
How about we just lose the cold war brain-rot and stop trying to use markets -- a legal fiction and policy tool!!! -- where they make no fucking sense. Markets are an incoherent solution to allocation problems where price signals are EXTREMELY delayed (education) or EXTREMELY coercive (health). Just fund it with tax dollars instead.
The market religion zombie from the red scare era needs to die. The amount of absolute brain rot in the American public caused by the inability to understand that markets are just fucking tools that depend on government coercion anyways is sending our entire society into a death spiral.
It's somehow unsurprising that the one true American religion of the 21st century -- deference to The Troops -- is the place where we're completely okay with socialism in higher education (the military academies).