I couldn’t figure out why TWRP kept asking me for a password on a new install of TWRP. I searched around the internet and found out why. It’s asking for the password on my phone lockscreen. What I did was boot the phone and remove the password and reboot. Now TWRP isn’t trying to decrypt things and doesn’t ask for a password!
Simple fix but I had been dealing with that problem for 8 months now and it couldn’t make reliable backups!
Regain your privacy! Adopt /e/ the unGoogled mobile OS and online services
It is strongly advised to remove lock scheme because key database won’t survive a restore.
Anyway, don’t forget to put back a lock after backup
Installing the OS, then setting up the same screen lock as before and then only restoring the data partition with TWRP worked for me, but that is dependent on the device because it requires encryption support in TWRP for the device, which is not guaranteed.