I always faced this issue with most of devices running custom ROM(with Stock UI), which is, it would hang at TWRP after a factory data reset. My phone's model is Xiaomi 13 Pro(but i faced the same issues generally with many other devices).
1 - Unit is a Chinese variant Xiaomi 13 Pro, so i wanted to flash it to Global. Bootloader ủnlöcked, installed TWRP.
2 - Installed xiaomi.eu ROM via fastboot, clicked on windows_install_and_format_data.bat file, successfully 100% done without errors, booted into system fine.
3 - the ROM seems like a global official one, with everything works perfectly.
4 - issues is when i try to perform a factory data reset. When i goto settings-additional settings-factory data reset...
5 - It will then boot into TWRP & won't enter system.
6 - I did tried to do a normal wipe in TWRP
7 - the basic wipe in TWRP resulted with error failed to mount '/data' (Invalid argument), seems like the data partition has some issues, reported 0MB.
8 - following some guides online, i then went to repair file system, set to ext2, then ext4, then the data's partition 256gb appears, but still wont boot into system.
9 - i will have to reflash it by starting from step 2, & it will work again, but i'll nvr able to perform a factory data reset.
Can someone pls guide me on how to properly run my unit with a xiaomi.eu ROM, that would also enable to factory data reset normally?