This is why I never shop at Walmart, if I did I would simply ignore the receipt guy. Why shop at a store that treats its customers like criminals/has enough criminal customers to warrant such a policy.
OTOH I know someone who is in charge of security at a Walmart, doing what the receipt checker did in this instance was against company policy. They are supposed to let you walk out and call the police, who will get there to late to do anything. Than review the security footage and discover you purchased it and wasted everyone's time.