### CI Link

https://gradle-enterprise.elastic.co/s/j3ajt4vzqybxs

### Repro line

gradlew ':x-pack:plugin:spatial:internalClusterTest' --tests "org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.testGeoShapeGeoHex" -Dtests.seed=67641D5B7DA4755B -Dtests.locale=en-IN -Dtests.timezone=Canada/Saskatchewan -Druntime.java=17 -Dtests.fips.enabled=true

### Does it reproduce?

No

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

The test in CI link above doesn't repro for me but I did run the test with multiple iterations. After around 250 of them, one failed for me:

```
REPRODUCE WITH: gradlew ':x-pack:plugin:spatial:internalClusterTest' --tests "org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.testGeoShapeGeoHex {seed=[3478FF74E8D66BB6:A2F98EBD906145BB]}" -Dtests.seed=3478FF74E8D66BB6 -Dtests.locale=sr-RS -Dtests.timezone=Europe/Luxembourg -Druntime.java=19

org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT > testGeoShapeGeoHex {seed=[3478FF74E8D66BB6:A2F98EBD906145BB]} FAILED
    java.lang.AssertionError: Expected hits at precision 15
    Expected: <3L>
         but: was <4L>
        at __randomizedtesting.SeedInfo.seed([3478FF74E8D66BB6:A2F98EBD906145BB]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.assertQuery(GeoGridAggAndQueryConsistencyIT.java:224)
        at org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.doTestGrid(GeoGridAggAndQueryConsistencyIT.java:215)
        at org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.doTestGeohexGrid(GeoGridAggAndQueryConsistencyIT.java:124)
        at org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT.testGeoShapeGeoHex(GeoGridAggAndQueryConsistencyIT.java:92)
```
x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoGridAggAndQueryConsistencyIT.java
}
            String doc = "{\"geometry\" : " + Arrays.toString(multiPoint) + "}";
            builder.add(new IndexRequest("test").source(doc, XContentType.JSON));
        }
        assertFalse(builder.get().hasFailures());
        client().admin().indices().prepareRefresh("test").get();
        for (int i = minPrecision; i <= maxPrecision; i++) {
            GeoGridAggregationBuilder builderPoint = aggBuilder.apply("geometry").field("geometry").precision(i);
            SearchResponse response = client().prepareSearch("test").addAggregation(builderPoint).setSize(0).get();
            InternalGeoGrid<?> gridPoint = response.getAggregations().get("geometry");
            assertQuery(gridPoint.getBuckets(), queryBuilder, i);
        }
        builder = client().prepareBulk();
        final int numDocs = randomIntBetween(10, 20);
        for (int id = 0; id < numDocs; id++) {
            String wkt = WellKnownText.toWKT(randomGeometriesSupplier.get());
            String doc = "{\"geometry\" : \"" + wkt + "\"}";
            builder.add(new IndexRequest("test").source(doc, XContentType.JSON));
        }
        assertFalse(builder.get().hasFailures());
        client().admin().indices().prepareRefresh("test").get();
        int zoom = randomIntBetween(minPrecision, maxPrecision);
        Rectangle rectangle = toBoundingBox.apply(tiles[zoom]);
        GeoBoundingBox boundingBox = new GeoBoundingBox(
            new GeoPoint(rectangle.getMaxLat(), rectangle.getMinLon()),
            new GeoPoint(rectangle.getMinLat(), rectangle.getMaxLon())
        );
        for (int i = minPrecision; i <= Math.min(maxPrecision, zoom + 3); i++) {
            GeoGridAggregationBuilder builderPoint = aggBuilder.apply("geometry")
                .field("geometry")