Probably the better solution is to include some kind of special lock-screen keyboard that provides some fallback mechanism to input any character. Presumably there are similar edge cases where someone creates a password using one keyboard, then switches keyboard layout, and now can't re-enter it using the active layout...
Wonder if you can get it to enter effective. Power لُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗
Indeed. For example, most desktop operating systems have a keybinding for «search for any Unicode symbol by name and input it». That would make sense to have as a fallback button on a virtual keyboard too.
The iOS emoji selector is close in UI/UX already, but the search is restricted to the emoji range of Unicode.