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.