The relevant law (art. 3 WZG[0]) requires persons to accept all banknotes (and up to 100 coins per transaction) as payment, but this only applies after a contract has been formed. It's perfectly legal for any store to indicate to customers that it will not accept large-denomination notes or cards[1]. If the customer is not willing or capable to pay using the accepted means of payment, no contract is formed, and the chewing gum remains with the store.
[0] https://www.admin.ch/opc/de/classified-compilation/19994336/...
[1] https://www.srf.ch/sendungen/kassensturz-espresso/geschaefte...