Doesn't Walmart do this without a membership? How do they get away with it?
Some states have https://en.wikipedia.org/wiki/Shopkeeper's_privilege
But that still requires cause to believe you stole something, and as far as I understand it, declining to be searched on its own doesn’t provide cause for that.
Costco has a membership agreement where you consent to being searched, Walmart does not.
They get away with it by training the vast majority to consent for no particular reason.
The worst that's ever happened was that I once had a Best Buy guard yell at me and start trying to chase me out into the parking lot, but I just ignored him and he eventually gave up and went back. Flaunting fake authority like that makes me very happy for some reason.