TWRP ask for password - cant mount data partition
i have experienced this with two other Xiaomi devices. first i could track it down to older unofficial variant of twrp 3.2.3 which is still decrypting with default password when official twrp 3.3.1 fails. so implementation of decrypting differs from each build, sometimes it is just a missing line in fstab, sometimes they forgot a flag during build.
But this is not the full explanation. Recently working twrp started to fail after MIUI OTA update. This means the encryption depends on ROM (system or vendor) therefore these partitions need to be mounted for decryption (which twrp normally does automatically).
encryption security may have changed/improved with new android version and twrp has not implemented that in your build. I have also seen twrp variant which does successfully decrypt userdata but does not mount /data because of a wired parameter related to disk quota. Flashing a disk quota disabler may help in this case. basically its a try and error to find a recovery which is working - which you have found.
Your question is therefore ot and should be discussed on github or developer boards