Shortages of baby formula is pretty rare here in the states, and building a business is a costly time consuming endeavor- you won't be able to spin one up just to make money during the shortage (testing, inspections, FDA approval for the labels, etc). That leaves other companies who are already running food businesses to possibly expand into it, but getting FDA approvals still takes time and a lot of money, so you need a longer term game plan for keeping it going.
A doctor writing a prescription for it doesn't help you get any if there's not any available in significant quantities- it's not a one and done thing, it is literally all the baby can eat until they've grown enough to be weaned off.
If it is available in any quantity then needing a prescription keeps it from being used for infants that don't need it. (Market naturally drops but I don't think risking the health of many infants who don't need formula to keep it cheap is a great ethical move anyway.)
There are infinitely refillable prescriptions and nutritional prescriptions, they have an advantage that they can be billed to health insurance which is fairer if an expensive diet is a medical need.
The overall effects of losing the local market, importing for infants that need it and having insurance pay much higher costs may well pay for itself if we could measure the future health consequences of unnecessary formula use.. but the rule of do no harm means we shouldn't try to feed kids formula without a medical need.
Ah, I didn't realize you meant waving a fiat wand so that everyone had to get a prescription for it.
If that were the case, then I imagine we could do the same with bottled water, gluten free grains, alcohol, vitamin supplements, coffee, CBD, and more, and solve so many problems!
Alas, the FDA has certain authority over drugs, and certain authority over food. It does not have the same authority over both, and infant formula is a food, not a drug.