I think that might be a myth? If I tried buying a $0.50 candy bar with a hundred-dollar bill, I think that the cashier might refuse it and I don't think they'd get in trouble for doing so.
I thought the "legal tender" argument only worked in regards to debts to the government, though IANAL.
Relevant Law: https://www.law.cornell.edu/uscode/text/31/5103
Good explanation: https://www.forbes.com/sites/nathanlewis/2017/04/18/what-is-...
Another distinction here is that a store is offering a contract. It isn't a debt until the contracted is accepted.