I did it . but it was very Hard for me to found the solution.
1. I have MI 8 SE and I flash MIUI 10.2 beta which has android 9.0 with TWRP and it seems OK.
2. I want to downgrade to MIUI 10 for some reasons
3. When I went to TWRP it ask for pattern password and it seems internal storage was encrypted!
4. I flash MIUI 10 Stable but the ROM didn't boot up.
5. I flash many other ROM with no help
Solution 1
6. Finally I use Miflashh and flash fastboot Rom and everything seems Ok but
7. when I flash recovery and want to flash some custom zip ram , after successful flash the Rom wont boot
8. I use many Rom with many Recovery but no help. Just I can have the fastboot Rom.
Final SOLUTION
9. Finally I found the solution. it was because of encrypted storage
10. you need to go to TWRP, then "Wipe" >> "Advanced Wipe" >> Check only "data" partition >> "Repair Or Change File System" >> "Repair File System"(if u haven't that button skip that step.). After that u need to Change File System of ur data partition. Choose "Change File System" and change it to FAT or exFAT(choose only one of two). After successfully changing the file system you need to change it back to EXT4. Just change it as I said earlier but here u need to choose only EXT4 in "Change File System" menu.
11. All data will be erase but you cat flash any custom ram
Sorry for bad English
And I'm not responsible for any thing but I test it myself