I am using Mİ 8 SE and I have had this problem myself. Sensors do not work by accidentally deleting persist.img file while TWRP is installed. I made this solution very simple and all the sensors work well
Just as you are downloading Mi 8 Se stabil Rom. Then find the persist.img file in the Rom file. After that, TWRP> install> in the lower right corner "Install Img" and then flashing the persist.img file. You should select "Persist" from there to open a window. Make the latest reboot device and restart the device and all the Sensors is running
i did flash persist.img from china rom..and sensor work
if flash img from the same rom work as well..then its more simple..no need china rom extract..nice