What you mean is the FRP lock and it's not local because you have to log into a Google account to complete activation of the phone. You can factory reset or change ROMs or do whatever you want and the phone will still refuse to work until you log in using the last Google account the device had.
That's not how it works. If the bootloader is unlocked, it won't work, obviously — and that's a prerequisite for flashing custom ROMs. Unlocking the bootloader on modern devices requires enabling the unlock in developer settings in the stock OS, and this requires unlocking the device.