If your requests are exactly the same and made with credentials that possess the exact same permissions and scopes, they should return the same data. If there are any differences whatsoever, the results may be different because of them. If you're sure there are literally no differences whatsoever between the requests, please open a case with Genesys Cloud Care to investigate further; customer-specific data cannot be investigated on the forum.
Make sense, but should the output not inform us of this difference.
Can you please verify whether my script is correct (syntactically) predicate condition etc.
This will help in explaining the admin that it is really the access/permission level issue.
I am trying to understand how the query syntax work, comparing the output between query builder and my own python stand alone script was/is the only option.
I doubt the output you have included above correspond to the files you have uploaded (the using_PureCloudPlatformClientV2.yaml and the using_header_request.yaml).
According to your code, the uploaded using_PureCloudPlatformClientV2.yaml is requesting the oWaiting metric (number of conversations in ACD Queue). And no filter on the mediaType (disabled in the code).
According to your code, the uploaded using_header_request.yaml is requesting the oOnQueueUsers metric (number of users on the ACD Queue - i.e On Queue presence state).
The response you are showing for using_PureCloudPlatformClientV2 shows oWaiting for the callback mediaType. So unless you have added a filter in your code, or unless you have extracted/copied a subset of your response, it doesn't match.
The response you are showing for using_header_request shows oWaiting for all media types. So unless you have modified the metric in your code (oOnQueueUsers), it doesn't match.
I have tried your code from using_PureCloudPlatformClientV2, adding before the get_client_credentials_token (as my Genesys Cloud org is in europe/dublin):
region = PureCloudPlatformClientV2.PureCloudRegionHosts.eu_west_1
PureCloudPlatformClientV2.configuration.host = region.get_api_host()
The OAuth Client (Client Credentials Grant) I have used has a role assigned, that only contains the analytics:queueObservation:view permission, on the Division(s) to which my ACD Queue(s) belong.
And the code works fine.
So you'll have to investigate on your side what you are doing wrong.
Or open a ticket with Genesys Cloud Care as we can't investigate customer data/environments on this forum.
According to your displayed response, you're doing a filter on callback mediaType (Callback conversations).
Your data output with conversations waiting in Queue was for voice media Type.