### 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
/*
 * 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.gateway;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionListenerResponseHandler;
import org.elasticsearch.action.support.ChannelActionListener;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateUpdateTask;
import org.elasticsearch.cluster.block.ClusterBlocks;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.IndexMetadataVerifier;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.RoutingTable;
import org.elasticsearch.cluster.routing.allocation.AllocationService;
import org.elasticsearch.cluster.routing.allocation.allocator.AllocationActionListener;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.UUIDs;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.StreamInput;