gmx_MMPBSA order of the molecules in the pdb file and topology file

GROMACS version:
GROMACS modification: Yes/No
I am working on a protein–protein system that also includes a glycan, arranged in the PDB file as Protein A → Protein B → Glycans, where the glycan is connected only to Protein A. I use GENESIS for MDS, which produces .dcd trajectories. I have successfully prepared and run gmx_MMPBSA on other systems without glycans, but the analysis does not work for this glycan-containing system.

Upon examining the topology files generated by CHARMM-GUI for GROMACS and GENESIS (for the same system), I noticed that the atom ordering differs:

GROMACS Output Topology: PROA → GLYCAN → PROB

GENESIS Output Topology: PROA → PROB → GLYCAN

As a result, the number of atoms selected in the index file does not match between the topology and trajectory files, leading to unrealistic outputs—which is understandable.

My question: When using GROMACS, is there a way to control the atom ordering in the topology file? If I generate a topology file with the order PROA → PROB → GLYCAN, will that resolve the mismatch and allow gmx_MMPBSA to work correctly with the glycan-containing system?