Inventory costs money not just due to the cost of storage, but also because it’s bought on credit. The higher the price, the more money needs to be borrowed. The longer it takes to sell it, the more interest needs to be paid.
(If it's not bought on credit, there is still opportunity cost, since that money could have been used for something else.)
(If it's not bought on credit, there is still opportunity cost, since that money could have been used for something else.)