Maybe your input volume axes defined a left-handed coordinate system? Could you provide some example files?
You can also try to save as NRRD file format, which has many advantages over NIFTI, one of them being that you can look at the image header with any text editor to see what is in it. You will see if the image geometry (origin, spacing, axis directions) of the segmentation is the same as the reference volume’s.