OK, the shop might not be happy about it, but you owe them the value of goods, and you've paid them in legal tender to the correct amount.
See for example thean who took cash from his company safe, and replaced the same value a week later, but who was convicted of theft because the notes were different. See R v Velyumi here: https://www.lawteacher.net/cases/theft-cases.php
Taking cash from a safe is also quite different to taking goods that are explicitly for sale. Especially if you gave them the right amount of money.
Note that Velumyl was an appeal on the grounds that the defendant did not intend to permanently deprive, thus the money being different was relevant as he permanently deprived the owner of that specific property. Had the defendant contented there was no dishonestly -- that he intended to return equivalent funds and believed that the company would consent -- the decision may well have been different.
[1] Theft Act 1968 s.2(1) https://www.legislation.gov.uk/ukpga/1968/60/section/2
If you leave bank notes of sufficient value and run out, they are very unlikely to attempt to prosecute you, but they could, both for the theft and the nuisance of leaving your property lying around in their store. And the case would probably be resolved on appeal somewhere, with one judge arguing that the state has an inherent interest in having its primary currency universally accepted by all businesses in its jurisdiction, and another arguing that the state is overreaching when it tells shopkeepers what they must accept as payment.