Actually what i mean is that the bug seems to happen when i do those steps i said, not only by trading it... but by removing the gem from inventory, the steps are:
get disconnected by COToBo's feature "disconnect on gem" , deactivate the feature, reconnect, remove the gem from inventory (could be by dropping it, trading it, storing it in warehouse, selling it to NPC, any of those) and activate the feature again. By the time i activate it again, my char will get disconnect as if i still had the gem in my inventory. I didn't test it by dropping the gem or selling to NPC, but i believe it will happen, since the corresponding function seems to be analising the inventory before it refreshs what you have. If it didn't refresh, COToBo will still see the gem in the inventory and disconnect you.
Srry if my english is bad or something like that ^^ i'm kinda late to go to class lol