For devs, it's slightly different. The customer patterns may not be consistent over time because devs are not always asked to build the same thing over and over again. Meanwhile, restaurant customers do order the same thing over and over again, so it's a lot easier to confirm the recipe timing and build order (just finished too much SC2) down to an exact science.
Yes, some devs may do nothing but build simple CRUD apps all month, and maybe they can get good at estimating what a simple CRUD app will cost based on their experience. But a lot of devs also work on things that have new and unique requirements for every single project, so the comparison with restaurants is not fair. And nothing against simple CRUD apps. Whatever brings home the bacon brings home the bacon.
And, yes, it is hard. That is part of my point. It is hard, but they address it and give it an effort. With luck, they make progress at getting better.
Contrast with devs. We spend a lot of time blaming others for why it is hard. (Requirements change, etc.) Ironically, this is something that day to day people have to deal with and adjust for accordingly. Based entirely on the historical perspective of dealing with similar items. That is, all of these are metrics that are trackable and reportable. With luck, they can be anticipated through estimation.
Sometimes that's actually expected. Some places allow a shortage to make the special scarce. Some places simply can't get ahold of enough of a key ingredient.
Consider, restaurants have to build in an estimate of how much service they expect at a given location. Before it even opens. Once open, they have to keep a steady supply of estimates tracking against how stocked the supplies should be. Do we truly think this is a skill people just have? Or one that is developed and has been refined through the years?
My personal belief is that we are too busy learning to program, such that we never dedicate time to learn to estimate. This works for the stars that can keep pace programming at the top of the field forever. However, as soon as things adopt a maintenance perspective, being able to estimate the amount of work you will have becomes key.