@joão-fornaza With Xiaomi you have to use a Windows PC and use the Mi Flash tool to flash back to stock ROM.

Word of warning with Xiaomi, DO NOT LOCK the bootloader once it is unlocked. You have a great chance of bricking the device.