And this is exactly why it is not regularly possible, nor supported or even necessary to add normal clients to query groups.
It breaks stuff irreparably and screws you over!
There is no way to recover except using backups before the server broke.
It is strongly advised to start again from scratch with a clean install or at least restore a backup from before clients were added to any query group!
When sending PMs please make sure to include a reference link to the thread in question in the body of your message.