### Elasticsearch Version

8.6.2

### Installed Plugins

_No response_

### Java Version

Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/18.0.2/18.0.2+9-61

### OS Version

Mac OS X/12.6.3/aarch64

### Problem Description

The [fields option](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.htm) lets you query the
metadata `_id` field, but this field doesn't seem to be returned consistently over larger search result sets.


### Steps to Reproduce

 add several small documents to a test index with e.g.
```
POST /test/_doc
{
  "foo" : "bar"
}
```
then query e.g. top 10 docs disabling `_source` and querying `_id` via `fields`:

```
GET test/_search
{
  "_source": false,
  "fields": [
    "_id"
  ],
  "size": 10,
  "query": {
    "match_all": {}
  }
}
```

In my current reproduction on 8.6.2 this returns e.g.
```
  "hits": [
            {
                "_index": "test",
                "_id": "082y5YYBJUrNWn3IOYNS",
                "_score": 1,
                "fields": {
                    "_id": [
                        "082y5YYBJUrNWn3IOYNS"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "1M2y5YYBJUrNWn3IQIOO",
                "_score": 1,
                "fields": {
                    "_id": [
                        "1M2y5YYBJUrNWn3IQIOO"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "1c2y5YYBJUrNWn3IRYNb",
                "_score": 1,
                "fields": {
                    "_id": [
                        "1c2y5YYBJUrNWn3IRYNb"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "1s2y5YYBJUrNWn3ITIMM",
                "_score": 1,
                "fields": {
                    "_id": [
                        "1s2y5YYBJUrNWn3ITIMM"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "182y5YYBJUrNWn3IUIPe",
                "_score": 1,
                "fields": {
                    "_id": [
                        "182y5YYBJUrNWn3IUIPe"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "2M2z5YYBJUrNWn3IN4O4",
                "_score": 1,
                "fields": {
                    "_id": [
                        "2M2z5YYBJUrNWn3IN4O4"
                    ]
                }
            },
            {
                "_index": "test",
                "_id": "2c2z5YYBJUrNWn3IUoNm",
                "_score": 1
            },
            {
                "_index": "test",
                "_id": "2s2z5YYBJUrNWn3IVYOr",
                "_score": 1
            },
            {
                "_index": "test",
                "_id": "282z5YYBJUrNWn3IWYNq",
                "_score": 1
            },
            {
                "_index": "test",
                "_id": "3M2z5YYBJUrNWn3IW4P9",
                "_score": 1,
                "fields": {
                    "_id": [
                        "3M2z5YYBJUrNWn3IW4P9"
                    ]
                }
            }
```

Notice hits 7-9 without the `_id` field. If queried directly, these documents show the field though:
```
GET test/_search
{
  "_source": false,
  "fields": [
    "_id"
  ],
  "size": 10,
  "query": {
    "match": {
      "_id" : "282z5YYBJUrNWn3IWYNq"
    }
  }
}

--->

"hits": [
            {
                "_index": "test",
                "_id": "282z5YYBJUrNWn3IWYNq",
                "_score": 1,
                "fields": {
                    "_id": [
                        "282z5YYBJUrNWn3IWYNq"
                    ]
                }
            }
        ]
```

Strangely, also changing the "size" seems to change which docs have the `_id` in the `fields` response and which don't.

### Logs (if relevant)

_No response_
server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java
searchResponse = client().prepareSearch().setQuery(matchQuery("text", "unify").fuzziness(Fuzziness.fromString("AUTO:5,7"))).get();
        assertHitCount(searchResponse, 1L);
        assertSearchHits(searchResponse, "2");
    }
    public void testMultiMatchQuery() throws Exception {
        createIndex("test");
        indexRandom(
            true,
            client().prepareIndex("test").setId("1").setSource("field1", "value1", "field2", "value4", "field3", "value3"),
            client().prepareIndex("test").setId("2").setSource("field1", "value2", "field2", "value5", "field3", "value2"),
            client().prepareIndex("test").setId("3").setSource("field1", "value3", "field2", "value6", "field3", "value1")
        );
        MultiMatchQueryBuilder builder = multiMatchQuery("value1 value2 value4", "field1", "field2");
        SearchResponse searchResponse = client().prepareSearch()
            .setQuery(builder)
            .addAggregation(AggregationBuilders.terms("field1").field("field1.keyword"))
            .get();
        assertHitCount(searchResponse, 2L);
        
        assertSearchHits(searchResponse, "1", "2");
        searchResponse = client().prepareSearch().setQuery(builder).get();
        assertHitCount(searchResponse, 2L);
        assertSearchHits(searchResponse, "1", "2");
        client().admin().indices().prepareRefresh("test").get();
        builder = multiMatchQuery("value1", "field1", "field2").operator(Operator.AND); 
                                                                                        
        searchResponse = client().prepareSearch().setQuery(builder).get();
        assertHitCount(searchResponse, 1L);
        assertFirstHit(searchResponse, hasId("1"));
        refresh();