Hi bro. I'm using xiaomi.eu 10.1 stable, and the portrait mode exists on back camera. I took pictures today and all is good.
Reflash the ROM, do a clean wipe, and try again.
And you could update your version of TWRP.
I don't know bro, try again.
Also, you could try with this module of Magisk. I'm using this module, I don't know if this module does the work with the portrait mode. You could try.