When faced with a shortage in some good or services a good first guess as to what might be going on is to see if there are price controls at work?
Go here to read a detailed analysis by John Goodman of what factors are at work in the ongoing shortage of over 200 hundred medications. It turns out that at least a contributing factor to the shortage is price controls which are part of a 1992 Federal 340B drug rebate program to certain medical facilities.
Another, perhaps more important governmental factor is at work in the form of the the output controls put in place by the FDA which limits the production of product by drug companies and diminishes their ability to quickly react to market conditions with increased production.
No, price controls are not the entire explanation but government price controls and other regulatory actions impeding market process are playing a role. The situation is more complicated that the two factors mentioned above and some of the other contributing factors are discussed here. But,as the various shortages play out, I'll be it won't be long until we hear that the free market has failed again and more governmental controls are necessary to protect the public.