webRequest.downloadHandler.text. Exception in JsonUtility in Unity

I didn’t go through your json line by line, but I’m going to assume everything is formatted properly. I had this issue with even a simple Json file:
"{ “anInt” : 5 } "

The issue was the same as appears here with WWW: JSONUtility.FromJson Error: Invalid Value

My JSON file was encoded as UTF-8 with BOM (Byte order mark). I created it in VSCode and it seems that it’s Microsoft best practice to include the BOM.

Maybe someone knows the best way to determine the text format, but if you can assume the file is UTF-8 with BOM you can strip the Byte Order Mark as shown in the post I linked.

Ex:

var jsonString = System.Text.Encoding.UTF8.GetString(
   unityWebRequest.downloadHandler.data,
   3,
   unityWebRequest.downloadHandler.data.Length - 3);