[Xiaomi Redmi Note 3 Themes, Apps, and Mods] otyg:
Found it to be ineffective against the latest lockscreen bugs.

I have made an attempt to fix the lockscreen bug that happens randomly on the kenzo (ie when you go to enter the pin number, the lock screen will keep appearing no matter if you input the correct value.) eventually you will have to delete the locksettings.db file to reset it so you can boot into the phone.

I have made a Magisk module that sets the locksettings.db file read-only meaning nothing can modify the file ('something' causes it to corrupt and develop the bug), unfortunately just setting it read-only will cause the OS not to boot so I had to set it read-write on boot then set it read-only after boot finishes., this is a quick 'fix' , I had several people test including myself and so far the bug has not appeared again, so it might just be luck or it's a effective fix, I put a 20 second delay on before setting it read-only so it might be possible for the bug to develop within this timeframe, but unlikely unless the system crashes on boot. so please make sure the system is stable before using the module.

Preliminary checks.
First make sure you currently don't have the 'bug' if you do flash a lock screen reset or delete locksettings.db, then setup a working lock screen., after you are satisfied, you can flash this module.

Bugs that might come from this module.
1. since it sets the file read-only, changing the lockscreen type or password might not work, you must disable the module, and either delete locksettings.db (from twrp), or change the permissions back to 660, then make your changes, then re-enable the module and reboot. - so I suggest using this module if you don't frequently change the lockscreen type or password/pattern/pin. I intended this to be a set and forget kinda fix.
2. I suspect a softreboot or systemui crash might cause the system to get stuck in a loop (untested) but I figure if it's the same as a normal reboot with it set readonly it will get stuck, if that happens then a force reboot might be necessary (power buttons pressed for 10 sec). again I am unsure if this will happen but there is a possibility.
3. Unknown, let me know.

Uninstall.
I had made this module for myself initially but figured more people might benefit from it (if it works), so uninstall / disable the module might require some manual fix-ups, so if you have problems here are the steps you should follow.

first reboot to twrp, go to /data/adb/modules/rn3plsf/ and delete the folder (this effectively disables the module, or you can use the orangefox magisk manager to disable / remove) , then go /data/system/locksettings.db and set permissions to 660 (you can also delete the locksettings.db file if you want to start new), reboot & everything should be as it was before.

I have only tested this on Android 10 (msm xtended), I am unsure if it will work on lower android versions, don't try it on selinux builds or miui. (well you can but it probably won't work)

-

This work is ALPHA, I expect the user to know how to use twrp and modify / delete files and are ok with experimenting, I may fix-up the module or make a uninstaller at a later date if it has good results, but for now I am just testing this. [B]use at own risk[/B],. I hope I have found a fix, but results are still to early to tell. please test and report back.

I don't check xda everyday, sometimes it can be weeks before I check I am pretty busy .