I was able to reproduce the issue of not having a keyboard to type the private space password after booting into safe mode while a third party keyboard was active. The system won't load the third party keyboard because the app providing it is disabled in safe mode, and the system keyboard isn't shown either, resulting in no way to input the password. This also makes it impossible to unlock your phone at all when you use a password on your main account by the way:
https://github.com/GrapheneOS/os-issue-tracker/issues/4662
Also, when the AOSP keyboard is active in safe mode, the keyboard switch icon on it lets you (try to) switch to the disabled third party keyboard while on an unlock screen, resulting in the same situation. It's a bit of a mess...
So another option is that the system somehow tries to load a non-existing or inaccessible keyboard. Outside of safe mode, when I set the default input method to a bogus value through ADB with settings put secure default_input_method bogus, no keyboard shows up anywhere you'd normally use a keyboard. The only way I found to resolve this through the regular user interface is adding or switching to another system language.
Does changing your system language resolve the issue?