So I've found a solution to the problem.
It seems as if the icon IDs are being returned as 32-BIT SIGNED INT. The max number for this type is 0x7FFFFFFF (2147483647) and some icon IDs are larger than that, reaching up to 0xFFFFFFFF (4294967295), being 32-BIT UNSIGNED INT limit.
To solve this, whenever retrieving IDs which are larger than 0x7FFFFFFF, simply apply bitwise AND operator to the number with 0xFFFFFFFF.
There's a solution example with PHP (lines 16 to 19):
PHP Code:
if($value['channel_icon_id']<0)
{
$value['channel_icon_id']=sprintf('%u', $value['channel_icon_id'] & 0xffffffff);
}
It seems like it's a bug with the TeamSpeak Query software.
If I'm wrong and there's another explanation, please let me know below.