So I had the same thing happen to my youngest son's tablet who did not have a passcode and it went flat, came on requesting a passcode. For some bizarre reason, it synched the passcode from my other son's tablet. Give that a shot maybe?
Also, I could not take the passcode off at all. So I set up face recognition and set it to open straight away without swiping. He's too little for the passcode and we fly for over 24hrs each journey and there's no way I'm unlocking screens constantly lol.