An iPhone screen passcode operates basically on a yes or no response basis. Does the code match, then unlock. But if the code doesn’t match, discard it. The only thing the system retains is how many times the wrong code is entered in succession - but that is just a count that’s stored). It doesn’t retain the wrong code, and the same wrong code can be entered multiple times. Regardless, after 10 failed attempts in a row, the device is permanently disabled (or the device is erased, if that option has been enabled).
If you use touchID or FaceID you can use a complex strong password in place of a numeric passcode (since you won’t be entering the code very often, it’s not too burdensome to occasionally have to enter an 8, 9, 10, 12 or whatever length alphanumeric password).