Question [Q] Trouble in downgrading / upgrading

I had an unlocked SGH-i317, which I had updated to a custom 4.1.2 CleanRom 4.9. CleanRom installed a rooted, deodexed ROM for N7105. I had unrooted the phone by removing SuperSU, as my company apps need an unrooted phone. This was working all fine so far.

With the launch of 4.3, I thought of updating the phone too. I downloaded the ROM 4.3 Singapore version for N7105 from SAMMobile and tried to flash using ODIN3.07. It failed at installing sboot.ini.

Then I downloaded Mawrick's 4.3 version from XDA and flashed it from recovery, along with Devil's Kernel to get the wifi working. Both installed fine, however, now I am not able to unroot the phone for my company apps to work. Miracast is not working either.

Then I downloaded the 4.1.2 stock ROM, and tried to flash using ODIN - it failed at the same place. Tried 4.3 stock ROM using ODIN, it failed as well.

All I need to do is to have the stock 4.3 ROM on my phone and I am not sure how I can get it done. Any help please!!!

Currently, when I go into download mode, it says -

Product Name: SGH-i317
Custom Binary Download : Yes (6 counts)
Current Binary: Custom
System Status: Custom


Below is the log from ODIN:

<ID:0/006> Added!!
<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> N7105XXDMB3_N7105OLBDMC1_N7105DXDLL1_HOME.tar.md5 is valid.
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/006> Odin v.3 engine (ID:6)..
<ID:0/006> File analysis..
<ID:0/006> SetupConnection..
<ID:0/006> Initialzation..
<ID:0/006> Get PIT for mapping..
<ID:0/006> Firmware update start..
<ID:0/006> tz.img
<ID:0/006> NAND Write Start!!
<ID:0/006> FAIL!
<OSM> All threads completed. (succeed 0 / failed 1)