There's a problem with that too: it would often force the owner of the phone to input the code when outside a secure environment, so a simple video surveillance could obtain the code.
GrapheneOS has a feature to scramble the locations of the numbers on the passcode unlock screen to prevent this exact problem
GrapheneOS has a feature to scramble the locations of the numbers on the passcode unlock screen to prevent this exact problem