Use TWRP to bypass Android lockscreen
TWRP custom recovery makes it quite easy to remove any kind of lock (except for fingerprint) from your Android device.
Reboot your phone into TWRP and click the "Advanced" button.
2. In the advanced options, click on "File Manager".
3. Navigate to \data\system.
4. Locate the "gesture.key", "password.key", "gatekeeper.pin.key" or "gatekeeper.pattern.key" file.
5. Long-press on the '*.key' file to reveal more options and choose "Rename File".
6. Add the extension ".old" to the file (the lock screen will be enabled afterwards by deleting the ".old" from the file name extension).
7. "Swipe" to confirm the renaming of the file.
8. After the file has been renamed, just click on "Reboot System".
9. After you boot into an Android, your lock screen should be removed completely or should accept any pattern/PIN/password you will try.
On some devices, the lock screen file can be named differently but it will always have ".key" at the end.