I have noticed that the returnUnformattedValues and returnFieldName parameters of the REST API is not working for the Identify on MapServer. Is there something special to enable to make it works? The doc says that it was added in 10.5
I took a screenshot of a request made to the REST endpoint. I have put a red rectangle around an attribute that is part of a domain and the coded value is not returned as expected. Also, the alias of the fields are not returned as expected with returnFieldName parameter set to false;
I also had the same problem in ArcGIS Enterprise 10.7 using an ArcGIS Pro published service. I don't know if it happens under specific circumstances but it doesn't happen in all my services.
In my case the service with problems is the only one published from ArcGIS Pro 2.4 to an ArcGIS Enterprise 10.7 (GIS Server), it has a join and it's data comes from an SQL Server Enterprise GDB.