Flick π¬π§ (npub1uxmβ¦ujtm) after reading everything, have you tried not drinking any water near bedtime and peeing before bed so you don't get a full bladder? Otherwise I don't know what this could be or what could be done for it.
I have IBS and when I get a very full bladder but can't get to a bathroom for maybe 10 or more minutes it can trigger sharp and painful muscle spasms in the abdominal and pelvic muscles. Maybe you could try having a full bladder and waiting while awake? That would be important to see if it's the cause. Then maybe a good pelvic floor therapist? I had one help me with my issues and it helped tremendously.
Also do you have any stress incontinence? That's ANY leaking of urine when you laugh/cough/sneeze?