I did some research back in the day so I'm going to reply this two old messages of mine (maybe it will be useful to someone):
Some box tools, like that, prevent relocking but with new versions of MIUI Xiaomi tends to fix this method so the unofficial server is not that "permanent". So, the best non-official solution to use a locked phone without worries is to delete the Mi account from the device (in EDL mode) with a modifed rawprogram.xml (or use one of the many device-specific ready to use solutions which already do this). Then, unlocking the bootloader and flashing a custom ROM is the way to go. Also, note that if you use a MIUI based ROM (i.e. Xiaomi.eu or the Stock one) once you connect it to the net the phone is gonna lock by it self again so it's necessary to remove certain apks with a custom recovery (CloudService.apk, XiaomiAccount.apk...) and probably the Updater too so in that way it's impossible to suffer a relock.
Since MIUI 9, you need an authorized Xiaomi account in order to flash any stock ROM with a locked device but there is a workaround: using a modified firehose programmer/loader file for your Qualcomm device chipset (signed by the OEM) allowing you to flash any stock ROM bypassing the auth requirement (there are a bunch of them leaked through Internet). Just overwrite the programmer file (.mbn, .elf...) of the ROM's folder with the modified one and flash with MiFlash. Done.
And thanks again
Franky38 for your posts I've got some interesting ideas/info to keep digging on the topic