GraphQL throwing a 502 when querying certain repositories without a helpful error message

When trying to query for specific repositories using the GraphQL API, a 502 error is thrown with the following details:

{
  "graphQLErrors": [],
  "clientErrors": [],
  "networkError": {
    "name": "ServerError",
    "response": {
      "size": 0,
      "timeout": 0
    },
    "statusCode": 502,
    "result": {
      "data": null,
      "errors": [
        {
          "message": "Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `31B6:4286:159E5C:2FDD47:6130BDC3` when reporting this issue."
        }
      ]
    }
  },
  "message": "Response not successful: Received status code 502"
}

Below is the query:

query ($owner: String!, $name: String!) {
  repository(owner: $owner, name: $name) {
    name
    defaultBranchRef {
      name
      target {
        ... on Commit {
          tree {
            ...listTree
          }
        }
      }
    }
  }
}

fragment listTree on Tree {
  entries {
    extension
    path
    type
    name
    object {
      ... on Blob {
        id
      }
      ... on Tree {
        entries {
          extension
          path
          type
          object {
            id
          }
          name
          ...treeEntry
        }
      }
    }
  }
}

fragment treeEntry on TreeEntry {
  object {
    ... on Blob {
      id
    }
    ... on Tree {
      entries {
        object {
          id
        }
        extension
        path
        type
        name
      }
    }
  }
}

Here are the sample variables:

{ "name":"android-linux-3.10", "owner":"NVIDIA"}
{ "name":"cutlass", "owner":"NVIDIA"}

It seems like the issue is caused by the inline fragment TreeEntry in the fragment treeEntry because when i comment it out, the query works.

Has anyone experienced this before? What could be the cause of this, and is there a fix/workaround?

Thanks.