[Xperia Z Original Android Development] :
Cant relock bootloader or return to stock

As I'm a tinkerer, I decided that I would root my phone, back up the TA then flash a custom rom (CM10.1). All that went swimmingly.

However, I'm now trying to flash back to stock so I can unlock the bootloader and then restore my TA backup.

So, root went fine, no issues. TA backed up, again no issues. Boot.img from CM10.1 flashed via fastboot, then I booted into the CWM recovery and flashed CM10.1 itself with gapps. All fine.

Then I attempted to revert back to stock. Tried flashing stock FTF with flashtool (and I've tried a few now, so not corrupt files) but this keeps failing. Tried using the BLU function as well, but get a similar error.

The error itself is to do with the loader. Logs provided below. Phone currently works with CM10.1, but want to be able to go back to stock and can't :(

Before I started, the bootloader unlock allowed status was YES in the service menu. Its a shop bought phone, as in unlocked and not on a contract, not carrier locked. I am using Win8 64 bit in test mode so I can use unsigned drivers - drivers for ADB and FASTBOOT tested and working fine so not a driver issue that I can tell. I flashed a zip in CWM concerning Bootloader Status Fix but this hasn't helped either. Oh, and yes the txt file with the unlock code is in the place it should be.

Any ideas anyone? If its something obvious I apologise but after doing a bit of a search on here and trying various different solutions I'm not getting anywhere.

FLASHING LOG:
16/006/2013 04:06:28 - INFO - Selected C6603 / 101.A.1.434 UK / Unbranded
16/006/2013 04:06:28 - INFO - Preparing files for flashing
16/006/2013 04:06:36 - INFO - Please connect your device into flashmode.
16/006/2013 04:06:37 - INFO - Opening device for R/W
16/006/2013 04:06:37 - INFO - Reading device information
16/006/2013 04:06:37 - INFO - Phone ready for flashmode operations.
16/006/2013 04:06:37 - INFO - Current device : Unknown: Feb 28 2013/16:29:18 - XXXXXXXXXX - Unknown: Feb 28 2013/16:29:18 - Unknown: Feb 28 2013/16:29:18 - Unknown: Feb 28 2013/16:29:18
16/006/2013 04:06:37 - INFO - Start Flashing
16/006/2013 04:06:37 - INFO - Processing loader
16/006/2013 04:06:38 - INFO - Ending flash session
16/006/2013 04:06:38 - ERROR - No loader found for this device
16/006/2013 04:06:38 - ERROR - Error flashing. Aborted

BLU LOG:
16/010/2013 04:10:11 - INFO - Please connect your device into flashmode.
16/010/2013 04:10:45 - INFO - Device connected in flash mode
16/010/2013 04:10:46 - INFO - Opening device for R/W
16/010/2013 04:10:46 - INFO - Reading device information
16/010/2013 04:10:46 - INFO - Phone ready for flashmode operations.
16/010/2013 04:10:46 - INFO - Current device : Unknown: Feb 28 2013/16:29:18 - XXXXXXXXXX - Unknown: Feb 28 2013/16:29:18 - Unknown: Feb 28 2013/16:29:18 - Unknown: Feb 28 2013/16:29:18
16/010/2013 04:10:46 - INFO - Processing loader
16/010/2013 04:10:46 - ERROR - No loader found for this device
16/010/2013 04:10:46 - INFO - Your phone bootloader cannot be officially unlocked
16/010/2013 04:10:46 - INFO - You can now unplug and restart your phone

EDIT:

Ok fixed this myself I think. Flashed another Rom via CWM (RomAur v2.3.1) after doing factory reset, but this rom would not boot (or I wasnt patient enough lol). I tested FlashTool again and found I could now both relock and flash files again. I relocked the phone, then flashed the standard 434 UK firmware FTF file. I then rooted it, and restored my TA backup. Then used the Sony Update Service system to restore the original firmware again. Checked service menu, and everything back to normal from what I can see. Don't know if the TA backup has restored BE2/DRM as I don't really know how to test that and not really bothered if they are indeed gone. Just happy I can now fiddle with my phone and know how to get it back on stock in future. If someone knows of a file I could have flashed or simpler way, feel free to let me know!