Inconsistent shifts over periodic boundaries in a molecule type

GROMACS version: 2022.1
GROMACS modification: No

Hello dear community I simulate 2 surfaces of kaolinite with water and sodium chloride between these surfaces. When the simulation is done I want to calculate the z-profile of the sodium and chloride with gmx density but these message appear

Command line:
gmx density -f 5md -s 5md -o test

Reading file 5md.tpr, VERSION 2022.1 (single precision)

Select 1 group to calculate density for:
Group 0 ( System) has 26196 elements
Group 1 ( Other) has 6000 elements
Group 2 ( SUP) has 6000 elements
Group 3 ( NA) has 41 elements
Group 4 ( CL) has 1 elements
Group 5 ( Ion) has 42 elements
Group 6 ( SUP) has 6000 elements
Group 7 ( NA) has 41 elements
Group 8 ( CL) has 1 elements
Group 9 ( Water) has 20154 elements
Group 10 ( SOL) has 20154 elements
Group 11 ( non-Water) has 6042 elements
Group 12 ( Water_and_ions) has 20196 elements
Select a group: 3
Selected 3: β€˜NA’
Reading frame 0 time 0.000
Program: gmx density, version 2021.2
Source file: src/gromacs/pbcutil/mshift.cpp (line 809)

Fatal error:
There are inconsistent shifts over periodic boundaries in a molecule type
consisting of 6042 atoms. The longest distance involved in such interactions
is 1.975 nm which is close to half the box length. This molecule type consists
of muliple parts, e.g. monomers, that are connected by interactions that are
not chemical bonds, e.g. restraints. Such systems can not be treated. The only
solution is increasing the box size.

For more information and tips for troubleshooting, please check the GROMACS
website at Common Errors β€” GROMACS webpage https://www.gromacs.org documentation
When I save my files I only save the non-Water atoms in the 5md files, hence the 6042, but It seems that It take like all my system is just one molecule. But the real system is one surfaces with 3000 atoms, a second surface with 3000 atoms, 41 Sodium ion, and 1 chloride ion.

Hello to all, I just resolve this issue.

The problem was that I included an artificial interaction like a planar dihedral because I simulate kaolinite on the 010 surface, to maintain the alignment of all the sheets, I included this dihedral which works, but it is a long range interaction and I create this problem when I tried to use gmx rdf.
So I only use this interaction in the equilibration steps and then remove it for the production step and problem solve.