Does the sterile cockpit rule mean flight attendants could not inform the pilots if a passenger is in the lavatory while on final?
"Sterile Cockpit" refers to the concept that pilots should not discuss anything not related to the flight during certain phases of flight (often defined as below FL100).

A passenger occupying the lavatory while the flight is on approach and passengers are supposed to be in their seats definitely does have an impact on the flight, so it does not fall under the "sterile cockpit"rule.