This has happened to me with passwords containing foreign characters. The system would accept it, but further logons would be impossible. Now I always strip diacritics to be safe.
A friend mentioned using control characters in passwords... like ^F and ^B, but not ^C because that's the interrupt character. Feels vaguely risky to me (does ^U empty the line? does ^W delete the last word? does your terminal emulator do some weird encoding like it does for cursor keys?) but if it works, why not?
I suspect I have run into a couple bugs because of password generators putting characters that some backend system cannot process in the password. Halfwish they just did DKWhhjwqjkwqjmHSJKHAIUHQwdmlsadkl instead.