Thank you @jcarlson for confirming your experience here as well and providing some more information.
I am interested in the work around you did by iterating over items in the fields object. I am seeing this information available in the layer query in ArcGIS Online but not unfortunately in ArcGIS Enterprise 10.8.1 on premises. Below is an example I see in ArcGIS Online today and on premises in 10.8.1 today. Is there some configuration missing maybe or is this just a newer feature in ArcGIS Online?
Example JSON for OBJECTID in ArcGIS Online:
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID",
"sqlType": "sqlTypeOther",
"domain": null,
"defaultValue": null
},
Example JSON for OBJECTID in ArcGIS Enterprise 10.8.1 on premises (missing sqlType and domain it looks like):
"fields": [
{
"name": "objectid",
"type": "esriFieldTypeOID",
"alias": "ObjectID",
"defaultValue": null
},