Exactly, this depends a lot on jurisdiction. I seem to remember that there are some places where you could basically spend the rest of your life in jail if you forget (with or without scare-quotes) your passport.
Yeah... It's like child support laws here where I live (never had to pay child support, have a friend that is a lawyer). They can hold you indefinitely until you come up with what they need. Forgot the password? Ah well, how convenient! We have this place just for you to sit and hopefully.one day remember!
Child support here, while I agree it should be being paid but people can run into hard times, is sort of like this but more ridiculous. If you are.behind on child support, they jail you indefinitely until you can pay it.... But you are in jail indefinitely and likely have lost your job if you had one. So....