If the problem does not solve using different ROMS and nobody has this issue (I am using Miui9 on Mi5) it is not seem a software problem.
Last possibility: try a not Miui ROM (Lineage).
More tests:
1.- Try booting up in recovery mode, This isn’t a fix, it would just tell you whether the phone is still capable of powering up its components without actually booting up to Android GUI.
2.- the USB C collects a lot of dirt in it, use a pin to scrape the dirt out.
If not charging in recovery mode o using Lineage, sure is hardware issue.
About hardware you could try change flex cable, it is cheap and you can do it. I hope it will not a motherboard problem.