Try doing a clean install using Mi Flash Tool with a fastboot ROM for your device model. This will wipe all data but fix most system errors. Make sure to:
Unlock bootloader (if not already).
Download the correct fastboot ROM for your device from the official MIUI site.
Use Mi Flash Tool to...