### Elasticsearch Version

8.3.0

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

arm64

### Problem Description

When using the `_terms_enum` API, if remote clusters return failures, but the local cluster doesn't, a null exception is thrown:

```
{
  "error": {
    "root_cause": [
      {
        "type": "null_pointer_exception",
        "reason": "Cannot invoke \"java.util.List.add(Object)\" because \"shardFailures\" is null"
      }
    ],
    "type": "null_pointer_exception",
    "reason": "Cannot invoke \"java.util.List.add(Object)\" because \"shardFailures\" is null"
  },
  "status": 500
}
```

### Steps to Reproduce

Call the _terms_enum API with a remote cluster that will return failures, e.g. because of this bug: https://github.com/elastic/elasticsearch/issues/86187

### Logs (if relevant)

_No response_
x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java
private final Parameter<String> value = new Parameter<>("value", true, () -> null, (n, c, o) -> {
            if (o instanceof Number == false && o instanceof CharSequence == false) {
                throw new MapperParsingException("Property [value] on field [" + n + "] must be a number or a string, but got [" + o + "]");
            }
            return o.toString();
        }, m -> toType(m).fieldType().value, XContentBuilder::field, Objects::toString);
        private final Parameter<Map<String, String>> meta = Parameter.metaParam();
        public Builder(String name) {
            super(name);
            value.setSerializerCheck((id, ic, v) -> v != null);
            value.setMergeValidator((previous, current, c) -> previous == null || Objects.equals(previous, current));
        }
        @Override
        protected List<Parameter<?>> getParameters() {
            return List.of(value, meta);
        }
        @Override
        public ConstantKeywordFieldMapper build(MapperBuilderContext context) {
            return new ConstantKeywordFieldMapper(
                name,
                new ConstantKeywordFieldType(context.buildFullName(name), value.getValue(), meta.getValue())
            );
        }
    }
    public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n));
    public static final class ConstantKeywordFieldType extends ConstantFieldType {