That could also work, if their system allows more digits than the standard digit length of their own phone numbers.
I've bumped into this issue myself when trying to fill my second phone number into input fields which require me to pass a number I actually use at the moment into systems where I do want to give them my phone number...
I did politely decline and didn't want to make a fuss about it - the title is bit exaggerated and from outside perspective it probably wasn't that dramatic.
I know that the cashier is just doing their job and I didn't want to make their day any harder than it probably already was. I smiled, thanked and left right after paying.
Hope I don't sound like a karen, just wanted to share my mundane experience in this community since I really love the discussion that is going on in this thread. I do hope that all of us in this community still remember the human when interacting with people in the real world.