Call the police to stop a store from criminally restraining the freedom of a customer to leave with their purchase after the customer pays the legally mandated maximum price which is often the lower of shelf and scanner price, yes. That's not going to be a high enforcement priority for the police, but it's absolutely a crime if the store does that.
>Call the police to stop a store from criminally restraining the freedom of a customer [...]
Realistically no store is going chase after the customer for that, but that doesn't mean the average shopper is going to risk arrest/banned (for what the store essentially sees as shoplifting) to send a $2 message over the price difference. And all of this assumes your novel legal theory is actually correct.
Your original idea of "paying the marked (lower) price, walking away, even if the cashier corrected you with the higher price" certainly is novel. Otherwise can you link any sort of judicial ruling or even a random lawyer that agrees with you?Otherwise this looks suspiciously similar to all the spurious legal theories that sovereign citizens have, about how they don't need a drivers license because they're "traveling" or whatever.
Similar laws exist at the state level in NY, in other NY counties, and in several other states and subdivisions of other states across the country.
In that case, the higher charge is clearly illegal (no novel theory needed), so standard contract law theory could consider the terms of the buyer's offer to purchase to be the terms of the invitation to treat in the absence of legal contrary terms offered at checkout. I guess it's possible that the court would say that the store never agreed to sell the item at all by demanding an illegal price instead of being considered to have accepted the buyer's offer on the posted terms, but there's only so much tolerance a judge would have for that kind of defense by the store - after all, it's very likely that the customer would have an unjust enrichment claim against the store for the amount of the overcharge if they were to pay the illegal higher price, and that wouldn't be true if the illegal contract term were valid.
The precise answer may vary by state based on judicial precedents about illegal terms in contractual counteroffers following an offer to buy made pursuant to an invitation to treat.
None of this is practical for almost any chain dollar store overpricing victim to pursue, but I am just talking theoretically here.