Hello, what worked for me on my MI 11 was the following, initially I installed TWRP, normally via fastboot, however, when installing the ROM, I got an error, when restarting, like in a loop, and it told me that "there was no operating system installed." Apparently when I installed the new TWRP, it was not left in the Ramdisk, so when it was rebooted, it returned to the previous version. What I had to do is copy via ABD, the TWRP IMG file to the internal storage, later, I went back to perform the TWRP installation via fastboot, and later, within the same menu, I accessed the "advanced" option, and I chose the "Install Recovery Ramdisk" option, and within that option, I chose the new TWRP IMG file, in the SDcard folder (it is the phone's storage) which I had passed via ADB, and installed it. By doing this, the new TWRP was installed in the RAMDISK memory and thus, when entering or restarting the TWRP, it no longer presents that loop. Later I installed the MIUI image, leaving only the last option (reboot after installation) activated after which the new version of MIUI, as well as my most recent TWRP, was installed normally.
I didn't have to delete anything, or modify anything, apart from the above, and all my files and applications were intact.
It should be noted that my device does not have a dedicated partition for recovery, and this can be changed depending on the cell's processor. My advice is that before installing the new TWRP, save a copy of the file in the internal memory of the phone, in case the problem can be solved as I did.
Here more information about this:
All custom recoveries come in the format of an IMG file (some are released as a flashable ZIP, like OrangeFox, but there's still an IMG inside). However, installation method will differ, depending on where the recovery ramdisk resides on your device specifically. Failing to install the custom...
xiaomi.eu
Devices with Boot as Recovery (A/B):
These devices don't have a dedicated partition for recovery.
The recovery ramdisk resides in the "boot_a" and "boot_b" partitions.
A shared kernel is used for both the system and the recovery.
Due to that, you should never flash a custom recovery image directly to the "boot_a" and/or "boot_b" partitions. If you do that, the system will fail to boot.
Platforms: Snapdragon 678/680/695/778G/778G+/780G/870/888/888+
Devices: alioth, haydn, lisa, mona, munch, odin, psyche, renoir, spes(n), star/mars, sunny, taoyao, thyme, venus, veux/peux, vili
Image size: 192 MiB (201,326,592 bytes), or 96/128 MiB (100,663,296/134,217,728 bytes) for low-mid devices
Installation:
code:
fastboot boot recovery.img
In the recovery interface: Advanced -> Install Recovery Ramdisk