Firstly it was tongue in cheek! I have no intent to shock my cat!
Second I'm 47 I've had cats and dogs my whole like. Angel my cat I have had since when she could barely pee herself, couldn't see and spent the entire day of office work either up my jumper or wrapping herself around my thigh for the body heat she would die without.
So I am her mum/dad.
On the carpet. She knows exactly what she is doing and she knows I know too. It is done deliberately as a way of getting my attention when she wants something.
Cats have no altruism. Cats have no empathy. Cats are born psychopathic narcissists. If a cat wants something, it has zero understanding, will or care about how that impacts any thing or anyone else. There is no reasoning with a cat for that reason. They don't care.
All you can do is either provide or deny , or ideally both. ie. "Don't shit on the floor", "Here, shit here instead".
I have bought her a whole cat tree with has 3 scratch posts. When I show her to use those, she looks at me as much to say, "No, they don't annoy you."
So she knows 100% if she starts pulling piles out of that carpet it WILL get my attention and when I get up, to shoo her, in her mind that is 90% of the battle won, I'm up, I'm coming for her, so if she makes it to the kitchen, I might as well let her out! Which is what she wanted.
The plant watering spray gun has been deployed recently. This was successful initially when Angel favouring coming into the office and literally taping me on the fore arm. However it quickly broke down again into a kind of game with her plucking the carpet just to get a reaction out of me then scarpering off and hiding only to return and repeat. I esculated such that she knew it was NOT a game. I followed her, found her and she looked at me with an "Uh oh..." expression and I shot her directly in the face.
Following that she was actually very apologetic and affectionate towards me. I think she got the message, realised it was me was her source of food and not to burn bridges with me and anger me as a game.
Annoyingly though.... once she was brought in last night she continually made demands to be let out again. "No. It's dark. You never keep the colars I give you, so you can't get out, you'll get hit by a car.". She persisted and persisted. I ignored her.
Anyway, you will have a laugh, as my post, intended only in fun mind was made after a repeated attempt on the carpet to get my attention.
Later when I went to bed I found out why. She had actually been telling me she needed out to be sick. There was a lovely pile of cat vomit on the floor, right were I put my feet in the morning. Angel was sitting with a satisfied expression like, "Well, I did try and get you let me out!"