Thanks! For users who are facing something similar, I found this to be really helpful,
1 - To make broken molecules whole:
gmx trjconv -f output.gro -s system.tpr -o new1.gro -pbc whole – Select the whole system - group 0
2 - Check if atoms jump across the box and put them back into the box:
gmx trjconv -f new1.gro -s system.tpr -o new2.gro -pbc nojump – Select the whole system - group 0
3 - Cluster all the atoms in a specific chosen group, and center the system in the box:
gmx trjconv -f new2.gro -s system.tpr -o new3.gro -pbc cluster -center yes – Select the the solid for the clustering and the centering, then select the system for output.
https://www.researchgate.net/post/How-to-remove-GROMACS-periodic-boundary-conditions