How come Gregg's et al, don't throw away masses of food? They let their shelves get empty by the end of the day if you take a look at their stores, yet they have not lost masses of customers because of this. That's good competent management right there, make the right amount of product you need for the day instead of vastly overstocking.
Greggs makes/defrosts/cooks items on the premises in batches throughout the day.
It is not hard to predict from hour to hour how many sausage rolls you need available or to react to demand when you can have product available very rapidly.
They will as a starter have charts or at least experienced staff who organise what needs to be ready by when to keep a reasonably stocked display.
Parts of a supermarket DO operate like that, the hot food section doing roast drumsticks for example.
That's extremely short term prediction of demand and supply can be turned up or down by how much you pull out of your storage to cook. A big enough cold store will have them covered fine.
But potatoes from various farms to central distribution and then to various stores is an educated long term guess based on past sales and expected events and cannot react to sudden demand or lack thereof.