The solution that worked for me was to enter the WiFi password as your Mi account password (where you should have a keyboard). After that, make the password visible, copy it and paste it as WiFi password. Then, you will be able to connect to WiFi as normal and can unlock your phone.