**Build scan:**
https://gradle-enterprise.elastic.co/s/6sxf663vnkl4g/tests/:server:test/org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileGridAggregatorTests/testBoundedMultiValuedDocs
**Reproduction line:**
```
./gradlew ':server:test' --tests "org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileGridAggregatorTests.testBoundedMultiValuedDocs" -Dtests.seed=A62BA7A35A3D27DF -Dtests.locale=nl -Dtests.timezone=Europe/Budapest -Druntime.java=21
```

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileGridAggregatorTests&tests.test=testBoundedMultiValuedDocs


**Failure excerpt:**
```
java.lang.IllegalArgumentException: invalid latitude -96.04741020128131; must be between -90.0 and 90.0

  at __randomizedtesting.SeedInfo.seed([A62BA7A35A3D27DF:F1F316E40DCC2FB]:0)
  at org.apache.lucene.geo.GeoUtils.checkLatitude(GeoUtils.java:64)
  at org.apache.lucene.geo.GeoEncodingUtils.encodeLatitude(GeoEncodingUtils.java:59)
  at org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileBoundedPredicate.<init>(GeoTileBoundedPredicate.java:49)
  at org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileCellIdSource.boundedCellMultiValues(GeoTileCellIdSource.java:69)
  at org.elasticsearch.search.aggregations.bucket.geogrid.CellIdSource.longValues(CellIdSource.java:65)
  at org.elasticsearch.search.aggregations.bucket.geogrid.GeoGridAggregator.getLeafCollector(GeoGridAggregator.java:75)
  at org.elasticsearch.search.aggregations.AggregatorBase.getLeafCollector(AggregatorBase.java:221)
  at org.elasticsearch.search.aggregations.MultiBucketCollector$1.getLeafCollector(MultiBucketCollector.java:92)
  at org.elasticsearch.search.aggregations.AggregatorCollector.getLeafCollector(AggregatorCollector.java:35)
  at org.elasticsearch.search.internal.ContextIndexSearcher.searchLeaf(ContextIndexSearcher.java:510)
  at org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:455)
  at org.elasticsearch.search.internal.ContextIndexSearcher.lambda$search$4(ContextIndexSearcher.java:370)
  at java.util.concurrent.FutureTask.run(FutureTask.java:317)
  at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
  at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
  at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.lang.Thread.run(Thread.java:1583)

```
test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregatorTestCase.java
gridBuilder.setGeoBoundingBox(bbox);
        }
        aggregationBuilder.subAggregation(gridBuilder);
        testCase(iw -> {
            List<IndexableField> fields = new ArrayList<>();
            Set<String> distinctHashesPerDoc = new HashSet<>();
            String t = randomAlphaOfLength(1);
            for (int pointId = 0; pointId < numPoints; pointId++) {
                Map<String, Long> expectedCountPerGeoHash = expectedCountPerTPerGeoHash.computeIfAbsent(t, k -> new TreeMap<>());
                double[] latLng = randomLatLng();
                fields.add(new LatLonDocValuesField(FIELD_NAME, latLng[0], latLng[1]));
                String hash = hashAsString(latLng[1], latLng[0], precision);
                if (distinctHashesPerDoc.contains(hash) == false) {
                    if (intersectsBounds(getTile(latLng[1], latLng[0], precision), bbox) || validPoint(latLng[1], latLng[0], bbox)) {
                        expectedCountPerGeoHash.put(hash, expectedCountPerGeoHash.getOrDefault(hash, 0L) + 1);
                        distinctHashesPerDoc.add(hash);
                    }
                }
                if (supplier.getAsBoolean()) {
                    fields.add(new Field("t", new BytesRef(t), KeywordFieldMapper.Defaults.FIELD_TYPE));
                    iw.addDocument(fields);
                    fields.clear();
                    distinctHashesPerDoc.clear();
                    t = randomAlphaOfLength(1);
                }
            }
            if (fields.size() != 0) {
                fields.add(new Field("t", new BytesRef(t), KeywordFieldMapper.Defaults.FIELD_TYPE));
                iw.addDocument(fields);
            }