Lots of pages here that I haven't read all of them to see if someone mentioned this, but I had a similar but different problem. At one point I bricked the thing, sbf would not flash whatsoever (tried multiple sbfs). Eventually RSDlite said it was done, but the phone still said "SW Update in progress". After trying to reboot the only thing I could get was "Code Corrupt". Flashing or anything else wouldn't work at all. The way I fixed it (tried 3x to make sure it worked perfectly...i bricked a lot lol):
Open the folder RSDlite is in, and delete any files that start with a date and end in flexlog, ie "09_14_22_10_21_FlexLog". Then delete any files that start with Flasherrorlog, like "FlashErrorLog09_14_22_10_21".
Uninstall the moto drivers via the install/uninstall exe
Uninstall RSDlite via the install/uninstall exe
You can restart your computer at this point if you want but I'm not sure its necessary
Reinstall moto drivers
Reinstall RSDlite, and don't forget to copy over the pst_flash file
Go into bootloader mode and flash the_gift w/ RSDlite. This can take ~15 minutes from clicking start to phone being rebooted
I'm not sure if all those steps are 100% necessary, but that's what definitely worked for me. If you're stuck and out of other options, give it a try.