### CI Link

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request+part-2/7561/

### Repro line

./gradlew ':x-pack:plugin:spatial:test' --tests "org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoTileTilerTests.testGeoGridSetValuesBoundingBoxes_UnboundedGeoShapeCellValues" -Dtests.seed=B78DF2D3C6E9F87B -Dtests.locale=es-PA -Dtests.timezone=Asia/Magadan -Druntime.java=8

### Does it reproduce?

Yes

### Applicable branches

7.17

### Failure history

_No response_

### Failure excerpt

```
  2> REPRODUCE WITH: ./gradlew ':x-pack:plugin:spatial:test' --tests "org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoTileTilerTests.testGeoGridSetValuesBoundingBoxes_UnboundedGeoShapeCellValues" -Dtests.seed=B78DF2D3C6E9F87B -Dtests.locale=es-PA -Dtests.timezone=Asia/Magadan -Druntime.java=8
  2> java.lang.IllegalArgumentException: Unable to Tessellate shape [[0.0, 0.0] [0.0, -3.7434056992857674E-259] [-6.00631214911533E-180, -3.7434056992857674E-259] [-6.00631214911533E-180, 0.0] [0.0, 0.0] ]. Possible malformed shape detected.
        at __randomizedtesting.SeedInfo.seed([B78DF2D3C6E9F87B:C2BBC29EF3DD375D]:0)
        at org.apache.lucene.geo.Tessellator.tessellate(Tessellator.java:116)
        at org.apache.lucene.document.LatLonShape.createIndexableFields(LatLonShape.java:72)
        at org.elasticsearch.index.mapper.GeoShapeIndexer$LuceneGeometryIndexer.visit(GeoShapeIndexer.java:246)
        at org.elasticsearch.index.mapper.GeoShapeIndexer$LuceneGeometryIndexer.visit(GeoShapeIndexer.java:178)
        at org.elasticsearch.geometry.Polygon.visit(Polygon.java:84)
        at org.elasticsearch.index.mapper.GeoShapeIndexer.indexShape(GeoShapeIndexer.java:174)
        at org.elasticsearch.xpack.spatial.util.GeoTestUtils.binaryGeoShapeDocValuesField(GeoTestUtils.java:54)
        at org.elasticsearch.xpack.spatial.util.GeoTestUtils.geoShapeValue(GeoTestUtils.java:60)
        at org.elasticsearch.xpack.spatial.search.aggregations.bucket.geogrid.GeoGridTilerTestCase.testGeoGridSetValuesBoundingBoxes_UnboundedGeoShapeCellValues(GeoGridTilerTestCase.java:161)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
        at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
        at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
        at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
        at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
        at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
        at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
        at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
        at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
        at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
        at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
        at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
        at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
        at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
        at java.lang.Thread.run(Thread.java:748)
```
x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/search/aggregations/bucket/geogrid/GeoGridTilerTestCase.java
expectThrows(CircuitBreakingException.class, () -> {
            GeoShapeCellValues values = new GeoShapeCellValues(makeGeoShapeValues(value), tiler, circuitBreakerConsumer);
            assertTrue(values.advanceExact(0));
            assertThat(values.getValuesBytes(), equalTo(curNumBytes));
            assertThat(limitedBreaker.getUsed(), equalTo(curNumBytes));
        });
    }
    protected GeoShapeValues makeGeoShapeValues(GeoShapeValues.GeoShapeValue... values) {
        return new GeoShapeValues() {
            int index = 0;
            @Override
            public boolean advanceExact(int doc) {
                assertThat(index, Matchers.greaterThanOrEqualTo(doc));
                if (doc < values.length) {
                    index = doc;
                    return true;
                }
                return false;
            }
            @Override
            public ValuesSourceType valuesSourceType() {
                return GeoShapeValuesSourceType.instance();
            }
            @Override
            public GeoShapeValue value() {
                return values[index];
            }
        };
    }
    private static Geometry boxToGeo(GeoBoundingBox geoBox) {