Question on diphenhydramine?

So, I have to take diphenhydramine at night just to be able to fall asleep due to my RLS. I’ve noticed that I could be laying in bed for a couple hours and not get drowsy yet, but once I get up to pee I suddenly get extremely drowsy and barely pass out immediately upon laying back down. Does anyone know why this might be? I’m mostly curious, I just want to fall asleep easier without having to get out of bed. And I can’t go to the doctor at the moment to ask him about it, I’m out of town and my healthcare is basically localised to the state I live in, and I’m too broke to pay for a doctor here.