You naturally feel the urge to pee if your bits are suddenly exposed to cold air, probably because warmth would indicate to the body that you are still in bed/under clothes (one of the mechanisms that stops bedwetting that not all of us have). When I feel thirsty in the middle of the night and need to swing my legs out over the bed so I can sit upright, I try to keep my crotch area warm and covered by the duvet, otherwise I will then need to visit the bathroom. So if you find yourself needing to pee in the middle of a change, sudden temperature change is the reason! I suppose the lesson is don't get changed in a cold room!