There are no restrictions on leaving the flightdeck to answer nature's call, maybe he chose to use the rear lavs. I often do this myself as it enables a bit of interaction with the pax, is good for DVT, and it helps me have good communication with the rear flight attendants, who I would otherwise never see.
Good on him!