Cannot make protein whole

GROMACS version: 2022.4
GROMACS modification: No

I have a simulation of a small peptide. I try to make the molecule whole by doing

gmx trjconv -f md_0_1.xtc -s em.gro -pbc whole -o whole.pdb

and choose the protein group.

but this results in some frames with broken molecules (see attached image).

em.gro itself is not broken. What am I missing?

To make molecules whole, you need to pass a .tpr file to the -s flag. Coordinate files do not have any bonded connectivity information.