Judging by our password reset request tickets, I can say "yes"
I've even forgotten a password just minutes after typing it. And I can't even tell you my desktop password despite typing it a dozen times a day for nearly 6 months. I once tried to give my wife the password over the phone and I couldn't do it without a keyboard to silently type on.
Usually only passwords are assumed to be remembered that are used many times with no sign of changing it.
Still, the defendant can claim that the whole ordeal of arrest and trial took a serious toll on his/her memory. Of course the judge might or might not believe it.
I once helped a professor decrypt a zip file by brute forcing the password (it was only 6 characters long). He swore it was his wife's name and that the file must be corrupt because he surely knows how to type her name. Turned out that it was a misspelling of her name, and he said "Oh right, I misspelled it to make it harder to guess".
I'm just claiming that this is how courts operate, not that it's the best thing ever and that it's infallible.
More than once, the first thing I've done after confirming a new account via email is reset my forgotten password. Am I guilty if I didn't bother to reset it right away?