### 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/test/java/org/elasticsearch/cluster/routing/allocation/decider/NodeShutdownAllocationDeciderTests.java
import org.elasticsearch.snapshots.EmptySnapshotsInfoService;
import org.elasticsearch.test.gateway.TestGatewayAllocator;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import static org.hamcrest.Matchers.equalTo;
public class NodeShutdownAllocationDeciderTests extends ESAllocationTestCase {
    private static final DiscoveryNode DATA_NODE = newNode("node-data", Collections.singleton(DiscoveryNodeRole.DATA_ROLE));
    private final ShardRouting shard = ShardRouting.newUnassigned(
        new ShardId("myindex", "myindex", 0),
        true,
        RecoverySource.EmptyStoreRecoverySource.INSTANCE,
        new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, "index created")
    );
    private final ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
    private NodeShutdownAllocationDecider decider = new NodeShutdownAllocationDecider();
    private final AllocationDeciders allocationDeciders = new AllocationDeciders(
        Arrays.asList(
            decider,
            new SameShardAllocationDecider(Settings.EMPTY, clusterSettings),
            new ReplicaAfterPrimaryActiveAllocationDecider()
        )
    );
    private final AllocationService service = new AllocationService(
        allocationDeciders,
        new TestGatewayAllocator(),
        new BalancedShardsAllocator(Settings.EMPTY),
        EmptyClusterInfoService.INSTANCE,
        EmptySnapshotsInfoService.INSTANCE
    );