Neither Amazon nor Walmart produce those commodities, they distribute them. Sure, there would be some initial issues, but both the remaining distributors as well as the producers would have strong incentives to quickly resolve those issues.
Companies like Amazon and Walmart massively distort the market, and do so quite deliberately. It's hopelessly naïve to think that if they vanished tomorrow, everyone would be able to just shrug and switch their purchasing to a drop-in replacement.
That's only possible in, as someone else described it, the "spherical cow in a vacuum" type of hypothetical free market. We live in the real world, where an arbitrary number of fully equivalent businesses can't actually continue to compete perfectly for everyone's money.
Do you think that there is enough inventory and stock to go around? Would those alternatives replenish their inventory in a timely fashion? Would you seek alternatives to your normal shopping?
I think people vastly overestimate the capabilities of their local options.