PBC correction for oligomers

Dear gromacs users,

I have run a simulation of a 24-mer peptide placed on top of a lipid bilayer perpendicular to the z-axis. Each of the monomer contains a total of 16-amino acid residues. I am using martini coarse-grained model. After running the simulation I am using trjconv -whole for making the molecules whole in my trajectory for visualization purposes. However, when I am viewing the trajectory on vmd the peptide seems broken and moving across the bilayer laterally along the xy direction. I followed the following protocol:
gmx trjconv -f md.xtc -s md.tpr -pbc whole -o whole.xtc << stop
0
stop
gmx trjconv -f whole.xtc -s md.tpr -pbc nojump -o nojump.xtc << stop
0
stop
gmx trjconv -f nojump.xtc -s md.tpr -pbc mol -ur compact -o nopbc_mol.xtc << stop
0
stop

After the final step when I am visualizing the trajectory I seeing broken peptide in multiple occasions. I have tried to use trajectory clustering as well, they did not work also. I am very new to simulating oligomers in gromacs and any help regarding solving this issue will be much appreciated, thanks in advance.