Funny how walmart (neighborhood stores) never seems to have this problem? at least that's what I see locally.. it's always stocked for the most part unless say we have a Hurricane coming our way!
People have different opinions on the pros and cons here. But it's not like Walmart always has every single product in stock 100% of the time, that would be super unlikely. If you never see empty shelves, then they just are using the "put something on the shelf" policy instead of the "leave it empty" policy.
Similarly, stores have a policy about what to do when there is a sell-out (leave the shelf empty or put something else there).
Each policy decision has pros and cons, and no store is immune to these issues.
Side note: Certainly Amazon is also very effective at logistics but I see that as almost a different use case than Walmart - i.e. centralized vs decentralized systems