I'll explain what I did to fix the error:
1) Connect the phone via USB and `adb shell` in
2) Switch to root via `su` (shell must be allowed in Magisk Manager)
3) Run `cd /data/data/com.android.providers.settings/databases/ && mv settings.db settings.db.broke && cp settings.db-backup settings.db`
4) Reboot the phone
If you can't get an adb root shell, you'll have to mount data from TWRP and fix it from there.