Hello and greetings:
Executing the code below will explain everything (I hope).
When the API consumes a Feature Layer with multiple sublayers, it fails to execute a query on the second thru nth sublayer. The API complains that there it cannot perform the operation because I'm using invalid query parameters.

More importantly, I just want to perform a query on a sublayer and to be able to specify the which sublayer to query. Any thoughts?
def main():
target_item_string = "_USE_AN_ITEM_ID_TO_GET_A_FEATURE_LAYER_"
gis = GIS("https://YOUR_DOMAIN.maps.arcgis.com", "superuser", "T0p5Ecr3T")
result = gis.content.get(target_item_string)
for layer in result.layers:
query_result = layer.query()
# do something with the query_result
TIA