### Elasticsearch Version

8.7.1

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

any

### Problem Description

When trying to use the [Import dangling index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/dangling-index-import.html), we've got the following message:
```
[2023-05-04T00:13:58,991][WARN ][o.e.g.LocalAllocateDangledIndices] [nemo002-master]ignoring dangled index [[test_index_20230503_1/EvcvFgJtRqiWxbDXqxQ4Rg]] on node [{nemo000-master}{CAePyz7iSdeT8NgWO9e3Ng}{h0Bc5NvPSXqZ0yztBTH83w}{nemo000-master}{1.2.3.4}{1.2.3.4:9303}{m}{8.7.1}{xpack.installed=true, cluster_id=john, rack_id=doe}] since its current compatibility version [8.4.3] is later than the oldest versioned node in the cluster [8.7.1]
```
Obviously, `8.4.3` is not later than `8.7.1`. Checking the source code, it can be seen that instead of the minimum node version, the master node's version is being logged:
https://github.com/elastic/elasticsearch/blob/ac9822be7247d33ad29ced39ae2eb5e4d3fcd189/server/src/main/java/org/elasticsearch/gateway/LocalAllocateDangledIndices.java#L143-L150

### Steps to Reproduce

have an ES cluster with mixed node versions
have an index created by a node of a newer version dangling in a node with an older version
try to import the dangling index: `POST /_dangling/<uuid>?accept_data_loss=true`

### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/gateway/LocalAllocateDangledIndices.java
}
                        if (currentState.metadata().hasIndex(indexMetadata.getIndex().getName())) {
                            continue;
                        }
                        if (currentState.metadata().hasAlias(indexMetadata.getIndex().getName())) {
                            logger.warn(
                                "ignoring dangled index [{}] on node [{}] due to an existing alias with the same name",
                                indexMetadata.getIndex(),
                                request.fromNode
                            );
                            continue;
                        }
                        if (currentState.metadata().indexGraveyard().containsIndex(indexMetadata.getIndex())) {
                            logger.warn(
                                "ignoring dangled index [{}] on node [{}] since it was recently deleted",
                                indexMetadata.getIndex(),
                                request.fromNode
                            );
                            continue;
                        }
                        importNeeded = true;
                        IndexMetadata newIndexMetadata;
                        try {
                            
                            
                            newIndexMetadata = indexMetadataVerifier.verifyIndexMetadata(indexMetadata, minIndexCompatibilityVersion);
                            newIndexMetadata = IndexMetadata.builder(newIndexMetadata)
                                .settings(
                                    Settings.builder()
                                        .put(newIndexMetadata.getSettings())