same thing happened to me when i had to restore to stock and relock.... try to put the
RAPHIMG.nbh from this zip onto your sd card and hold the power button and volume down button while soft resetting... if this is successful, rename the RUU_signed.nbh from any rom to RAPHIMG.nbh and do the same thing.
if this works, you can try the flash back to stock and relock again