This is what I meant, it adds the isMerc column to the groups table so that it won't glitch as so, I had the same issue, bots grouped fine, but players had an issue, code below to fix.
Code:
ALTER TABLE `group_id` ADD COLUMN `ismerc` tinyint(3) NOT NULL DEFAULT 0 AFTER `name`, DROP PRIMARY KEY, ADD PRIMARY KEY (`groupid`, `charid`, `ismerc`);