Let's say that you write a bill "you can't sell insulin for over $100". If insulin sellers refuse to sell for less than $100, there's no insulin available.

However, the bill might also say that insurance companies must keep the out-of-pocket costs under $100 or that the state will make up any amount over $100.

In reality, it seems unlikely to harm insulin availability since most jurisdictions have cheap insulin and the cost in the US seems to be significantly higher.

Theoretically, price caps can be set low enough that no one will produce and sell an item. If you capped the price of computers at $100, no one would be making and selling computers and you wouldn't be able to find a computer without going to the black market. Countries like Venezuela have tried price caps on goods and what has happened is that those goods can't be found. Retailers won't sell items for less than they can get them from a supplier and suppliers won't sell for that price, possibly due to the cost of inputs, production, shipping, etc.

In this case, there's evidence that prices have been inflated unfairly with insulin and therefore this just hurts suppliers' margin without really changing availability. However, there is the potential that suppliers won't work with the price restriction. Let's say that you're CVS and you're buying an insulin drug from BigPharmCo at $150. Illinois has a new law such that you can't sell insulin for more than $100 so you tell BigPharmCo that you need supplies at $60 so that you can sell it for $100 and pay for stores, employees, etc. BigPharmCo decides that they'd rather not sell it to you at $60 because they'd rather write off Illinois sales all together rather than reduce their price to $60. Illinois is only about 4% of the US population. If you lower your price to $60, you're losing 60% of your revenue. If you write off Illinois, you're only losing 4% of your revenue.

Now, you might argue that they'd only have to give CVS a discount on supplies for Illinois, but that would be hard to enforce. It seems legal to ship medical stuff across states. Would it be legal to prevent someone from entering into interstate commerce they've always been accustomed to? I have no idea. Maybe suppliers would only supply a certain amount they deemed necessary for the Illinois population to CVS at the discounted price. However, then why wouldn't CVS just stop selling in Illinois and sell the discounted insulin for a higher price in other states?

Even if one can prevent cross-state shipment of insulin, suppliers might deem it worth their while to make an example out of Illinois. If they don't make an example out of Illinois, other states will likely follow. They might get some bad press, but at some point the state would need to act to protect the welfare of its people and repeal the restriction.

I'm not saying that any of these things are good or righteous. It's just harder to force people to do what you want than many people think. Given that forms of insulin are generic, maybe the answer is that we need more generic manufacturers to make it competitive.

Again, I don't think shortages are likely to happen. GoodRx shows generic Humalog available for under $70, but many others are much more expensive. I don't know enough about insulin prices to really know what will happen. However, in many instances, price caps haven't been really effective at helping people.