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...
I often open packages so I can actually see the product before buying it (if the package is not sealed shut), and I've always wondered whether this catches the attention of people on the cameras. I've never done this in electronics stores, but for stores like Princess Auto (similar to Harbor Freight), particularly in the surplus section, it's practically required because so much stuff comes in generic boxes with no or poor pictures amd very little labelling. Other stores, too.
The Target system isn't 100% effective though. I once saw a guy ask to see a laptop, then grab it and make a mad dash for the door. He got away with it. I think it was shortly afterwards when they moved the electronics department to the back of the store.
They yelled to stop. I yelled back to call the cops if they have proof.
And... nothing happened. Nothing ever happens. Because I don't steal; I go through the register; and I leave with product that I now own.