Test exception:

```java.lang.IllegalArgumentException: failed to parse date field [+50856544-06-06T15:21:11Z] with format [yyyy-MM-dd'T'HH:mm:ss.SSS'Z']
        at __randomizedtesting.SeedInfo.seed([46B9DC8375CF7B16:A5F9C3E22746820]:0)
        at org.elasticsearch.common.time.JavaDateFormatter.parse(JavaDateFormatter.java:211)
        at org.elasticsearch.common.time.DateFormatter.parseMillis(DateFormatter.java:39)
        at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.lambda$parameters$11(ToDatetimeTests.java:121)
        at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.lambda$unary$28(TestCaseSupplier.java:537)
        at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:74)
        at org.elasticsearch.xpack.esql.expression.function.AbstractFunctionTestCase.lambda$anyNullIsNull$5(AbstractFunctionTestCase.java:620)
        at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:74)
        at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:48)
        at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.<init>(ToDatetimeTests.java:31)```

**Build scan:**
https://gradle-enterprise.elastic.co/s/uhqm6chppewcm/tests/:x-pack:plugin:esql:test/org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests/testEvaluateInManyThreads%20%7BTestCase=%3Cdate%20string%3E%7D


**Reproduction line:**
```
./gradlew ':x-pack:plugin:esql:test' --tests "org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.testEvaluateInManyThreads {TestCase=<date string>}" -Dtests.seed=46B9DC8375CF7B16 -Dtests.locale=ar-OM -Dtests.timezone=Asia/Vientiane -Druntime.java=21
```

**Applicable branches:**
main

**Reproduces locally?:**
Yes

**Failure history:**
[Failure dashboard for `org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests#testEvaluateInManyThreads {TestCase=<date string>}`](https://es-delivery-stats.elastic.dev/app/dashboards#/view/dcec9e60-72ac-11ee-8f39-55975ded9e63?_g=(refreshInterval:(pause:!t,value:60000),time:(from:now-7d%2Fd,to:now))&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:twoLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!t),panels:('0c0c9cb8-ccd2-45c6-9b13-96bac4abc542':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:task.keyword,grow:!t,id:'0c0c9cb8-ccd2-45c6-9b13-96bac4abc542',searchTechnique:wildcard,selectedOptions:!(),singleSelect:!t,title:'Gradle%20Task',width:medium),grow:!t,order:0,type:optionsListControl,width:small),'144933da-5c1b-4257-a969-7f43455a7901':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:name.keyword,grow:!t,id:'144933da-5c1b-4257-a969-7f43455a7901',searchTechnique:wildcard,selectedOptions:!('testEvaluateInManyThreads%20%7BTestCase%3D%3Cdate%20string%3E%7D'),title:Test,width:medium),grow:!t,order:2,type:optionsListControl,width:medium),'4e6ad9d6-6fdc-4fcc-bf1a-aa6ca79e0850':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:className.keyword,grow:!t,id:'4e6ad9d6-6fdc-4fcc-bf1a-aa6ca79e0850',searchTechnique:wildcard,selectedOptions:!('org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests'),title:Suite,width:medium),grow:!t,order:1,type:optionsListControl,width:medium)))))


**Failure excerpt:**
```
java.lang.IllegalArgumentException: failed to parse date field [+50856544-06-06T15:21:11Z] with format [yyyy-MM-dd'T'HH:mm:ss.SSS'Z']

  at __randomizedtesting.SeedInfo.seed([46B9DC8375CF7B16:A5F9C3E22746820]:0)
  at org.elasticsearch.common.time.JavaDateFormatter.parse(JavaDateFormatter.java:211)
  at org.elasticsearch.common.time.DateFormatter.parseMillis(DateFormatter.java:39)
  at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.lambda$parameters$11(ToDatetimeTests.java:121)
  at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.lambda$unary$28(TestCaseSupplier.java:537)
  at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:74)
  at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:48)
  at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.<init>(ToDatetimeTests.java:31)
  at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
  at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:486)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$NewInstanceProvider.newInstance(RandomizedRunner.java:1588)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:941)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  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 org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1583)

  Caused by: java.time.format.DateTimeParseException: Text '+50856544-06-06T15:21:11Z' could not be parsed at index 24

    at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2108)
    at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1936)
    at org.elasticsearch.common.time.JavaDateFormatter.doParse(JavaDateFormatter.java:240)
    at org.elasticsearch.common.time.JavaDateFormatter.parse(JavaDateFormatter.java:209)
    at org.elasticsearch.common.time.DateFormatter.parseMillis(DateFormatter.java:39)
    at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.lambda$parameters$11(ToDatetimeTests.java:121)
    at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.lambda$unary$28(TestCaseSupplier.java:537)
    at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:74)
    at org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier.get(TestCaseSupplier.java:48)
    at org.elasticsearch.xpack.esql.expression.function.scalar.convert.ToDatetimeTests.<init>(ToDatetimeTests.java:31)
    at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:486)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$NewInstanceProvider.newInstance(RandomizedRunner.java:1588)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:941)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
    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 org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
    at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
    at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
    at java.lang.Thread.run(Thread.java:1583)

```
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDatetimeTests.java
public ToDatetimeTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCaseSupplier) {
        this.testCase = testCaseSupplier.get();
    }
    @ParametersFactory
    public static Iterable<Object[]> parameters() {
        final String read = "Attribute[channel=0]";
        final List<TestCaseSupplier> suppliers = new ArrayList<>();
        TestCaseSupplier.forUnaryDatetime(suppliers, read, DataTypes.DATETIME, Instant::toEpochMilli, emptyList());
        TestCaseSupplier.forUnaryInt(
            suppliers,
            "ToLongFromIntEvaluator[field=" + read + "]",
            DataTypes.DATETIME,
            i -> ((Integer) i).longValue(),
            Integer.MIN_VALUE,
            Integer.MAX_VALUE,
            emptyList()
        );
        TestCaseSupplier.forUnaryLong(suppliers, read, DataTypes.DATETIME, l -> l, Long.MIN_VALUE, Long.MAX_VALUE, emptyList());
        TestCaseSupplier.forUnaryUnsignedLong(
            suppliers,
            "ToLongFromUnsignedLongEvaluator[field=" + read + "]",
            DataTypes.DATETIME,
            BigInteger::longValueExact,
            BigInteger.ZERO,
            BigInteger.valueOf(Long.MAX_VALUE),
            emptyList()
        );
        TestCaseSupplier.forUnaryUnsignedLong(
            suppliers,