Genion modifying my system in unexpected ways

GROMACS version: 2023
GROMACS modification: No
Hello Gromacs users, I am attempting to use genion to ionize a coarse grained system. The system consists of (among other things) two types of lipid molecules, PCN and PCA, which are included in the .top file in addition to their associated .itp files. When I run genion to add NaCl, it asks which group of solvent molecules to select:

Group 0 ( System) has 575172 elements
Group 1 ( Other) has 554398 elements
Group 2 ( PCN) has 87750 elements
Group 3 ( W) has 466648 elements

For some reason, PCA isn’t listed, but in any case I select group 3, and the command finishes successfully and indeed the water beads are replaced with Na and Cl. However, the .gro file that it outputs has completely replaced all PCA molecules with PCN. In the initial .gro file that I used, it was an equal mix of PCN and PCA. The only thing I can think of that could be affecting things is that the PCA and PCN molecules are not listed continuously (as in there are 3605 PCN, then 3605 PCA, then 5170 PCN, then 5170 PCA). I would appreciate any insight as to why this is happening. Thanks.

The [molecules] directive of your system topology needs to exactly match the coordinate file, and if not, grompp will rename things based on what it finds in the topology (but will warn you about the mismatch). Did grompp issue any warnings when building the .tpr file for genion?

Thanks for the reply. There were no warnings issued during the generation of the .tpr file, but this was after I modified the topology file in the following way:

[ molecules ]
; name number
PCN 3605
PCA 3605
PCN 5170
PCA 5170

So that the order of the PCN and PCA molecules matches the .gro file. I will probably just try and rearrange the .gro file so that all PCN are listed first, then all PCA, just to be sure. In the meantime though I am open to any other suggestions.