I think i found permanent fix for those sensors issue. You should try
#1 Flash Stock FTF
#2 Open Phone, Finish Setup, Flash TWRP & Launch TWRP
#3 Go To Backup -> Select Persist (and maybe firmware?)
#4 Flash Your Desired Rom
#5 If There Are Sensors Issue, Launch TWRP
#6 Go To Restore -> Select Persist (and maybe firmware?)
#7 Restart And Done
#1 Flash Stock FTF
#2 Open Phone, Finish Setup, Flash TWRP & Launch TWRP
#3 Go To Backup -> Select Persist (and maybe firmware?)
#4 Flash Your Desired Rom
#5 If There Are Sensors Issue, Launch TWRP
#6 Go To Restore -> Select Persist (and maybe firmware?)
#7 Restart And Done