Earlier quoted context omitted.
Are those people optimizing for having every product available at every time? They have to balance against the very real cost of spoilage, so I don’t think they consider the occasional out–of–stock as the system breaking
Yes they are. Product availability is the most important factor in choosing a grocery store, as unavailability makes people need to visit additional stores or change recipes/plans on the fly. Some spoilage is factored in and is just a minor bit of negative PR. However, the supply chain disruptions since 2020 are too big for any grocery chain to "solve". https://hbr.org/2004/05/stock-outs-cause-walkouts
For many people, price is almost certainly at least as big a factor. Many, perhaps even most, people are willing to accept things being out of stock now and then for 10% lower prices.