My uBPDw has asked me to accompany her to the bathroom in the middle night, but typically only after she has watched a scary movie before going to bed (just like a child might do I suppose). Maybe try something in SET format along these lines that involves a cool gift:
"I love being near you and value the sense of closeness that we have. I can tell that it's reassuring to you for me to be there with you at night when you get up to use the bathroom, and I'm sure it would feel unpleasant not to feel safe or cared-for when you get out of bed at night. I care about how you feel during late-night bathroom trips and want to be here for you when you need me. At the same time, I need my sleep in order to function during the day, and so I can't continue to wake up and get out of bed each time you use the bathroom. Here's a special LED flashlight that I bought for you so that you know you are safe when you get out of bed during the night (pick out something she might like, maybe a pink flashlight or one with her name engraved on it). You can keep this by your side of the bed to use whenever you have to use the bathroom."
Then be prepared to duck if she throws the flashlight at you.

But stand firm, you have a right to sleep uninterrupted.