Ligand_ini.pdb is forming a distorted structure of ligand after running python script

GROMACS version:2022.4
Dear all,
I am Trying to run ligand-protein complex MD simulation in GROMACS. My ligand_ini.pdb and ligand.gro files are not generating properly.After running of python script downloaded from MacKerell lab website a file is generated: ligand_ini.pdb. After viewing it in VMD it does not look like the ligand any more.There is no error in python script.I am using latest version of charmm36 force field and networkx version 2.5(also tried version 2.4).Python version 3.9.12. After viewing ligand_ini.pdb in vmd it is forming some dotted distorted structure(screenshot attached).Also attached ligand_fix.gro


)

Probably the residue name in the stream file (RESI entry) was longer than 4 characters and caused the PDB file to be misformatted. Change the residue name and try to convert again.