Open a Scarlet or Violet save in PKHex. Click Tools > Data > Encounter Database. In the new window that will open, select Miraidon as the species and click search. You will see two Miraidon, one being the one you get at the start of the game, the other being the spare you can capture at the end. Right click on the version you want, select "View", and PKHex will generate a new, non-cloned legal copy of the pokemon for you to put into your save.I got a second Myradon while using a cheat with an individual value of 6V, and I don't have the official data for Myradon, so if anyone has it, I'd like you to distribute the data.
You can do this for any pokemon; spawned in the open world, static encounters (including the starters), trade pokemon, breeded pokemon, etc (though if it's a pokemon that existed in previous versions you might want to select Scarlet or Violet in the OT Version). Using the encounter database means you start from a legal pokemon, making it much easier to keep the final result legal.