Reproduces more or less deterministically on https://demo.elastic.co

```
POST _query
{
  "query":"from metrics-* | stats avg(event.duration) | limit 10"
}
```

```
Caused by: java.lang.NullPointerException: Cannot invoke "org.elasticsearch.index.mapper.MappedFieldType.typeName()" because "fieldType" is null
	at org.elasticsearch.xpack.esql.stats.SearchStats.detectSingleValue(SearchStats.java:185)
	at org.elasticsearch.xpack.esql.stats.SearchStats.lambda$isSingleValue$10(SearchStats.java:168)
	at org.elasticsearch.xpack.esql.stats.SearchStats.doWithContexts(SearchStats.java:283)
	at org.elasticsearch.xpack.esql.stats.SearchStats.isSingleValue(SearchStats.java:167)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.lambda$pushableStats$0(LocalPhysicalPlanOptimizer.java:379)
	at java.util.Map.computeIfAbsent(Map.java:1066)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.pushableStats(LocalPhysicalPlanOptimizer.java:364)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.rule(LocalPhysicalPlanOptimizer.java:331)
	at org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizer$PushStatsToSource.rule(LocalPhysicalPlanOptimizer.java:323)
	at org.elasticsearch.xpack.esql.optimizer.PhysicalOptimizerRules$ParameterizedOptimizerRule.lambda$apply$0(PhysicalOptimizerRules.java:37)

```


x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/stats/SearchStats.java
var stat = cache.computeIfAbsent(field, s -> new FieldStat());
        if (stat.max == null) {
            var max = new byte[][] { null };
            doWithContexts(r -> {
                byte[] localMax = PointValues.getMaxPackedValue(r, field);
                
                if (localMax != null) {
                    if (max[0] == null) {
                        max[0] = localMax;
                    } else {
                        throw new EsqlIllegalArgumentException("Don't know how to compare with previous max");
                    }
                }
                return true;
            }, true);
            stat.max = max[0];
        }
        
        return null;
    }
    public boolean isSingleValue(String field) {
        var stat = cache.computeIfAbsent(field, s -> new FieldStat());
        if (stat.singleValue == null) {
            
            if (exists(field) == false) {
                stat.singleValue = true;
            } else {
                var sv = new boolean[] { false };
                for (SearchContext context : contexts) {
                    MappedFieldType mappedType = context.getSearchExecutionContext().getFieldType(field);