### Elasticsearch Version

main

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

21.6.0 Darwin Kernel Version 21.6.0: Thu Jul  6 22:18:26 PDT 2023; root:xnu-8020.240.18.702.13~1/RELEASE_X86_64 x86_64

### Problem Description

fields option is not returning values with an array of objects. See example in "Steps to Reproduce". Problem brought up in Kibana SDH https://github.com/elastic/sdh-kibana/issues/4114

### Steps to Reproduce

```
PUT test
{}

PUT test/_mapping
{
  "properties": {
    "results": {
      "properties": {
        "value": {
          "type": "geo_point"
        }
      }
    }
  }
}

PUT test/_doc/1
{
  "results": [
    {
      "value": [
        {
          "lat": 0,
          "lon": 0
        }
      ]
    }
  ]
}


POST /test*/_search
{
  "_source": false,
  "fields": [
    "results.value"
  ]
}
```

In the response, notice how fields is not populated and no value is returned

```
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "test",
        "_id": "1",
        "_score": 1
      }
    ]
  }
}
```

I would expect to get a response like 
```
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "test",
        "_id": "1",
        "_score": 1,
        "fields": {
          "results.value": [
            {
              "coordinates": [
                0,
                0
              ],
              "type": "Point"
            }
          ]
        }
      }
    ]
  }
}
```

### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/common/xcontent/support/XContentMapValues.java
}
    }
    /**
     * For the provided path, return its value in the xContent map.
     *
     * Note that in contrast with {@link XContentMapValues#extractRawValues}, array and object values
     * can be returned.
     *
     * @param path the value's path in the map.
     * @param nullValue a value to return if the path exists, but the value is 'null'. This helps
     *                  in distinguishing between a path that doesn't exist vs. a value of 'null'.
     *
     * @return the value associated with the path in the map or 'null' if the path does not exist.
     */
    public static Object extractValue(String path, Map<?, ?> map, Object nullValue) {
        String[] pathElements = path.split("\\.");
        if (pathElements.length == 0) {
            return null;
        }
        return extractValue(pathElements, 0, map, nullValue);
    }
    private static Object extractValue(String[] pathElements, int index, Object currentValue, Object nullValue) {
        if (currentValue instanceof List<?> valueList) {
            List<Object> newList = new ArrayList<>(valueList.size());
            for (Object o : valueList) {
                Object listValue = extractValue(pathElements, index, o, nullValue);
                if (listValue != null) {
                    newList.add(listValue);
                }
            }