On another forum, a vet said that "there are risks to the surgery, including permanent incontinence since you are operating around the anal muscles, and there is always a risk of permanent nerve damage."
Did your vet tell you about risks?
Make sure you go with a good vet who knows what they're doing.
Someone on that same forum said they've never seen a dog have problems after the surgery, so it sounds like risks are uncommon.
It sounds like this surgery is something that needs to be done for little P-nut. I'm sorry she's in so much pain
I'm sure she'll be fine!! Don't hesitate to ask your vet many many questions