The difference is, a bank only has a certain amount of money, while a grocery store can turn over inventory on a daily or weekly basis. So if I stock up now before everyone else does, I can actually make less of an impact if and when there is an eventual need for everyone to prepare to stay home for a week.
Functionally the grocer has a limited supply also because there is only so much production/shipment capacity. I agree if you do it early enough your impact is minimal.
But if you withdraw early enough from a bank then the bank can in theory safely exit from its positions and become more liquid
However, the problem is if you don't try to get stuff before or during the panic you get screwed yourself. Its why its a dangerous feedback loop. If you don't join in you lose/ get negatively effected by it.
Its kinda of a prisoners dilemma but at a larger scale.