### 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
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.cluster.routing.allocation.decider;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ESAllocationTestCase;
import org.elasticsearch.cluster.EmptyClusterInfoService;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.cluster.metadata.NodesShutdownMetadata;
import org.elasticsearch.cluster.metadata.SingleNodeShutdownMetadata;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.routing.RecoverySource;
import org.elasticsearch.cluster.routing.RoutingNode;
import org.elasticsearch.cluster.routing.RoutingNodesHelper;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.routing.UnassignedInfo;
import org.elasticsearch.cluster.routing.allocation.AllocationService;
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.shard.ShardId;