That's literally how the button works. An undersupply in the market, increases prices.. kids and students deciding what they want to do with their life, see the wages and decide 10 years of school is worth it... and after 10 years you get more doctors.
If there's an undersupply, that's a clear indication that young people are looking at the field and deciding the wages don't justify the investment.
By short-circuiting the process of the free market, you're guaranteeing the shortage will continue.