### 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/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java
throw blockException;
            }
            nodes = clusterState.nodes();
            logger.trace("resolving shards based on cluster state version [{}]", clusterState.version());
            nodeBundles = getNodeBundles(clusterState, concreteIndices);
            expectedOps = nodeBundles.size() + remoteClusterIndices.size();
            atomicResponses = new AtomicReferenceArray<>(expectedOps);
        }
        public void start() {
            if (expectedOps == 0) {
                
                try {
                    listener.onResponse(mergeResponses(request, new AtomicReferenceArray<>(0), true, nodeBundles));
                } catch (Exception e) {
                    listener.onFailure(e);
                }
                
                return;
            }
            
            int numOps = 0;
            for (final String nodeId : nodeBundles.keySet()) {
                if (checkForEarlyFinish()) {
                    return;
                }
                Set<ShardId> shardIds = nodeBundles.get(nodeId);
                if (shardIds.size() > 0) {
                    performOperation(nodeId, shardIds, numOps);
                } else {