Did you flash using the fastboot .tgz or zip MIUI file? Did you format data at any time or did not need it since this would make it a clean flash by default?I've flashed the latest MIUI (13.0.4) via MiFlash-Tool (Version: MiFlash2018-5-28-0.zip) and then flashed TWRP => CrDroid 8.5=> FlameGapps 12.04.2022) =>FlameGapps SearchAssitant (=>DFE). Now everything works as expected!
Shutdown works fine and PowerOffAlarm too.
Flashing latest MIUI via Recovery ends up in an error, maybe there was the problem!