This will probably not be done in practice, but I like hypotheticals.
I believe that when you flash a custom recovery on a bootlocked device the stock recovery will just be flashed back on reboot. This is because stock ROMs have a backup image of the stock recovery. But what happens when you flash a custom ROM without touching the stock recovery? I doubt it can be flashed back.
I can think of two ways to flash the custom ROM: 1) fastboot 2) boot into a non-flashed custom recovery image (using fastboot), then use that to flash the ROM.
What will happen if either method succeeds in flashing the custom ROM on a device with a locked bootloader?