### Elasticsearch Version

7.17.1

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Ubuntu 18.04

### Problem Description

Problem originally discussed [here](https://discuss.elastic.co/t/auto-expand-replicas-not-working-on-enrich-index/313569). See the complete discussion and the things I've tried there.

Summary
* 3 nodes cluster, all nodes have all roles (`node.roles` is not defined, so nodes have all roles)
* All system indices with `auto_expand_replicas: "0-all"` are not replicated. Problem exists on enrich indices, kibana indices, monitoring indices , etc.
* Problem can be reproduced with a regular, user-defined index simply by setting `auto_expand_replicas: "0-all"` in index settings as per the reproduction script below

On my cluster, the indices always have 0 replicas. I've tried to force set `number_of_replicas` to a higher value with no luck, value is reverted to 0 immediately. I've enabled TRACE logging on a few loggers around allocation, I've got plenty of logs but none mentioned the inability to replicate thoses indices...

Can you help troubleshoot the issue?

Thanks in advance,

Cheers,
David

### Steps to Reproduce

Kibana script
```
PUT /testing_auto_expand_replicas
{
  "settings": {
    "auto_expand_replicas": "0-all"
  }
}

GET /testing_auto_expand_replicas/_settings

GET _cluster/allocation/explain?include_yes_decisions
{
  "index": "testing_auto_expand_replicas",
  "shard": 0,
  "primary": true
}
```

### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/NodeShutdownAllocationDecider.java
public Decision canRemain(IndexMetadata indexMetadata, ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
        return this.canAllocate(shardRouting, node, allocation);
    }
    /**
     * Prevents indices from being auto-expanded to nodes which are in the process of shutting down, regardless of whether they're shutting
     * down for restart or removal.
     */
    @Override
    public Decision shouldAutoExpandToNode(IndexMetadata indexMetadata, DiscoveryNode node, RoutingAllocation allocation) {
        SingleNodeShutdownMetadata thisNodeShutdownMetadata = allocation.nodeShutdowns().get(node.getId());
        if (thisNodeShutdownMetadata == null) {
            return allocation.decision(Decision.YES, NAME, "node [%s] is not preparing for removal from the cluster", node.getId());
        }
        return switch (thisNodeShutdownMetadata.getType()) {
            case RESTART -> allocation.decision(
                Decision.YES,
                NAME,
                "node [%s] is not preparing for removal from the cluster (is " + "restarting)",
                node.getId()
            );
            case REPLACE, REMOVE -> allocation.decision(
                Decision.NO,
                NAME,
                "node [%s] is preparing for removal from the cluster",
                node.getId()
            );
        };
    }
}