On newer Xiaomi devices, Android Verified Boot (AVB) can block wipes if the digest mismatches.
Connect to a PC and use the Mi Flash Tool to perform a "Clean All" flash. This requires downloading the correct Fastboot ROM for your specific Xiaomi, Redmi, or POCO model.