ProxySql just stop working, no idea why. And no matter what query is used error would be the same.
9006 ProxySQL Error: connection is locked to hostgroup XX but trying to reach hostgroup YY
ProxySQl version: ProxySQL version 2.3.2-10-g8cd66cf_DEBUG, codename Truls
This error can occur after ProxySql v2.0.6 on Single Primary Member configuration in Group Replication setup.
This means that one group will be able to read write The other one will be used only for reading data.
As is explained in the documentation for proxySql variable mysql-set_query_lock_on_hostgroup
So to resolve this issue on the single primary server on Group replication try to do this.
Log into ProxySql admin monitor
Not mandatory but the ProxySql service can be restarted in order to check if variables are saved on disk.