They do NOT like being restricted to the area that their tray is in, how would you like to be tied to your toilet for a week and be expected to eat your meals in there too?
My cat has only just stopped peeing on the floor on our hallway and it was because her food bowls were too close to her tray and she was unhappy about it.
Took us ages and a lot of frustration to work that out, but we CERTAINLY wouldn't tie her up near her tray for a week!
Please don't follow that advice, whether it worked or not it's a very mean and unkind thing to do to a pet.
If you use a bio clothes washing powder like biozet mixed with water, it will neutralize the smell of the urine so the cat won't be drawn back there. Then once you're done that a couple of times and it's dry, you can spray on febreeze if there's still a smell (although the ammonia smell that draws the cat should be gone).
I'd say your puss just did it because of the discomfort after surgery. I don't know what happened but kitties even in mild pain will sometimes go out of the tray because they're trying to avoid more pain. Whether stepping into the tray, squatting, or bowl movements themselves hurt.
Hopefully it doesn't happen again, although even if it does I think given that your puss has not long had surgery it CERTAINLY doesn't deserve cruel punishment .