This always happens to me with passwords. I have trouble remembering some passwords. Yet, when I'm in front of the page and I actually need to get in, either I lose some focus and let my unconsciousness do the work or I won't get it right.
The problem was he had cleaned his keyboard a couple of days earlier and put some keys back wrong. When he was sitting down he logged in by touch typing. Standing up he looked at his keyboard when he typed.
(Applies also to those government warrants forcing you to divulge information.)