### CI Link

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

### Repro line

./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.search.aggregations.bucket.RandomSamplerIT.testRandomSamplerHistogram" -Dtests.seed=AED6446652EDAB2B -Dtests.locale=cs -Dtests.timezone=Africa/Bangui -Druntime.java=17

### Does it reproduce?

No

### Applicable branches

master

### Failure history

_No response_

### Failure excerpt

```
org.elasticsearch.search.aggregations.bucket.RandomSamplerIT > testRandomSamplerHistogram FAILED
    java.lang.AssertionError: 
    Expected: a value less than <127.55000000000001>
         but: <145.07999999999993> was greater than <127.55000000000001>
        at __randomizedtesting.SeedInfo.seed([AED6446652EDAB2B:B3962E383F3EDAC]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.junit.Assert.assertThat(Assert.java:956)
        at org.junit.Assert.assertThat(Assert.java:923)
        at org.elasticsearch.search.aggregations.bucket.RandomSamplerIT.testRandomSamplerHistogram(RandomSamplerIT.java:157)
```
server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RandomSamplerIT.java
ensureSearchable();
    }
    public void testRandomSampler() {
        double sampleMonotonicValue = 0.0;
        double sampleRandomValue = 0.0;
        double sampledDocCount = 0.0;
        SearchRequest sampledRequest = client().prepareSearch("idx")
            .addAggregation(
                new RandomSamplerAggregationBuilder("sampler").setProbability(PROBABILITY)
                    .subAggregation(avg("mean_monotonic").field(MONOTONIC_VALUE))
                    .subAggregation(avg("mean_numeric").field(NUMERIC_VALUE))
            )
            .request();
        for (int i = 0; i < NUM_SAMPLE_RUNS; i++) {
            InternalRandomSampler sampler = client().search(sampledRequest).actionGet().getAggregations().get("sampler");
            sampleMonotonicValue += ((Avg) sampler.getAggregations().get("mean_monotonic")).getValue();
            sampleRandomValue += ((Avg) sampler.getAggregations().get("mean_numeric")).getValue();
            sampledDocCount += sampler.getDocCount();
        }
        sampledDocCount /= NUM_SAMPLE_RUNS;
        sampleMonotonicValue /= NUM_SAMPLE_RUNS;
        sampleRandomValue /= NUM_SAMPLE_RUNS;
        double countError = (numDocs * 0.25) * 0.1;
        assertThat(Math.abs(sampledDocCount - (numDocs * 0.25)), lessThan(countError));
        SearchResponse trueValueResponse = client().prepareSearch("idx")
            .addAggregation(avg("mean_monotonic").field(MONOTONIC_VALUE))
            .addAggregation(avg("mean_numeric").field(NUMERIC_VALUE))
            .get();
        double trueMonotonic = ((Avg) trueValueResponse.getAggregations().get("mean_monotonic")).getValue();
        double trueRandom = ((Avg) trueValueResponse.getAggregations().get("mean_numeric")).getValue();