Thanks.
I managed to get a working link to the Xiaomi flash utility and got an official china Rom on it to start again.
The second time, I then wiped all of the memories following instructions from a post in here. I then was able to update to the eu 10.4 Rom. It seemed to work, but later rebooted and I had a similar problem. Not a black screen, but a boot loop.
Again, I got the official China Rom on it and tried a 3rd time. This time, I got the TWRP image on, then installed Magisk. Did a format, rather than wiping the relevant partitions and then installed 10.4.
This time, it seems to have worked. Also TWRP is loaded into recovery, which it never was before as it would always revert back to the bunny after rebooting.
Its been a painful process trying to find proper instructions on how to load these Roms onto the Mi 5X. Many of the instructions just say "install . . ." without actually telling you how to do it which means a lot of guessing.
For example, it says install TWRP, but no instructions. The instructions say to load and boot it via adb, but once the phone it rebooted, TWRP always disappears. Does that mean the TWRP image also needs to be installed through TWRP? Who knows.
I'd write up a process myself to put on here, if only I knew whether the way I did it was correct.
I'm not sure what version of android the ROM i'm trying to use is based on, but it's the latest, stable, available for the Mi5X