I have a Xiaomi A2 which went into a bootloop due to a buggy Android 11 OTA update. It's a bug in the update, and a lot of people are affected. My phone really had a rather vanilla setup (original Android One ROM). The only exotic thing I did was to unlock the bootloader. Everything else is untouched.
When I installed the Oct 2020 OTA update (version V184.108.40.206.QDIMIXM) my phone went into a boot loop. So I booted on TWRP from fastboot, and using
adb pull /dev/block/mmcblk0p69 data.img I got an entire disk image of my data partition on my PC.
Using fastboot I then flashed the previous known-working OS version (version V220.127.116.11.QDIMIXM) but then when I boot my phone I now have a weird problem: my PIN isn't recognized anymore! If I try and remove
/data/system/locksettings.db from TWRP, then it does remove the PIN and I can "log in" with a swipe, but then the phone gives me a never ending spinner. I assume something is wrong with File-Based Encryption and the fact that I didn't provide a PIN.
Question: why is my PIN not working anymore? How can I get it to work?