5ttgen and co-register

Hi experts
When I used the demo data and script of the Mrtrix to practise, the regisitration step went wrong. The x and z axis of the 5tt_coreg.mif switched, which led to a terrible connectome. Nevertheless, if I co-registered registered the 5tt_nocoreg.mif to the demo one or deleted the first slice prpendicular to the Y-axis of the 5tt_nocoreg.mif, the registration results were normal, and final connectome was very similar to the demo data (r = 0.98).
However, there was no problem in running the registration step alone, but there was a problem when combining 5ttgen and registration. I have felt so comfused and have not got the answer yet. I would appreciate you if you could provide some insight of this problem.
Best wishes!