This is not an intractable problem.
For medicine, it's easier to balance the ratios when you can fully control the pipeline, and also control the total number of new practitioners entering the workforce regardless of demand.
If you only have 28,000 residency slots a year, institutions can pick whoever they want, and get the diversity numbers that they want. They decide who eventually gets to work in the field. Employers and customers don't have any real choice. They're going to get whatever the schools provide, and if they don't like it, they can go without doctors.
Modern tech is nothing like that, but it could be someday. Imagine if schools decided who could be professionally employed as a software engineer.