Phone is locked with an impossible to enter password
In case there is a problem with the on-screen keyboard most devices support to use an USB keyboard connected via USB On-The-Go (OTG) adapter to the phone - if the phone supports USB OTG at all.

The simpler an USB keyboard is the more likely it will work - keyboards with integrated USB hub and/or readers for smartcard or sd-card often cause problems and may not work.

Note that the USB keyboard works like a regular keyboard (not like the on-screen keyboard): key combinations like have be pressed at the same time, not one after another.