I tried doing a factory reset on my Nexus 6 and the device got stuck in "Erasing". All I am able to do now is enter fastboot flash mode but none of the options work as the boot loader is locked.
Tried flashing with a factory image from here but that too failed because the device is locked.
--------------------------------------------
Bootloader Version...: moto-apq8084-72.01
Baseband Version.....: D4.01-9625-05.42+FSG-9625-02.113
Serial Number........: ZX1G524DKM
--------------------------------------------
checking product...
OKAY [ 0.002s]
checking version-bootloader...
OKAY [ 0.002s]
checking version-baseband...
OKAY [ 0.003s]
sending 'boot' (8485 KB)...
OKAY [ 0.268s]
writing 'boot'...
(bootloader) Not allowed in LOCKED state!
FAILED (remote failure)
finished. total time: 0.287s