It was a bit tongue in cheek, and I'd most likely never do it on a widebody flight where I could not have seen the door all of the time.
I have unlocked the door on a narrow body when I have been seated with clear line of sight, and it is obvious the crew has gone in to galley prep mode and forgot the lavatory door. But then I know for a fact that no one was in there, I have seen the door being locked from the outside, and not being unlocked again.