The pilot crew rest is across from that lavatory on a 772 and uses a third mid-hallway door to access.
The pilots often turns on a switch in the lavatory door sill to keep the lavatory occupied cabin light on.
The crew showed me the location (upper left door sill. Looks like a regular flat switch to turn off.
My recommendation is to check lavatory door manually since it should unlocked if unoccupied regardless of the light.