I had done this before with one of CM 10 and I kept the files used in this thread.
I switched to AOKP kitkat 12-30-13. I wanted to return to stock and unrooted.
I got to the oem ruu and kept receiving this message. FAILED (remote: 90 hboot pre-update! please flush image again immediately)
I did this repeatedly as followed. It went over 5 times. I figured this was a problem. Now I am stuck in the bootloader where my phone is locked and S-on. I tried to flash it again and now I get remote: 12 signature verify failed.
It also says ***TAMPERED*** at the top of bootloader, above ***LOCKED***
Edit: I wanted to mention that I do have a backup of my kitkat state at the beginning of all of this. It is in twrp, but I can't flash install the twrp.img, signature verify failed.