I've done that at Walmart before. Walmart has this policy where if the item you bought is too big to be put in a bag the greeter tries to check your receipt.
You're right - they can't do anything. But it still is a very unpleasant interaction. Also, not very effective anyways. Target on the other hand doesn't check receipts, but they have a well trained loss prevention team that watches the cameras and they know when someone is stealing. The only person who gets a bad experience is the person committing the crime.
Overall though, I just hate the experience of going into stores in general these days. Not just because of COVID, it's because in almost all cases, the staff is incentivized to sell you things that make the company the most profit. Either because they get a commission or because if they don't they get their hours cut etc... They aren't actually trying to help you solve your problem, which is the whole point of having sales associates.
So now I end up doing independent research on whatever I'm going to buy, it's usually cheaper online and I don't get asked if I have a rewards account, what my phone number/email is, what my zip code is, do I want to open a credit card? etc etc...