There's currently a check in `TransportService.HandshakeResponse.isIncompatibleBuild` to stop ES with the same Version but different build hashes from joining a cluster. This needs to be relaxed for cloud deployments where Version is not applicable
server/src/test/java/org/elasticsearch/transport/TransportServiceHandshakeTests.java
}
                    @Override
                    public void sendResponse(TransportResponse response) throws IOException {
                        assertThat(response, instanceOf(TransportService.HandshakeResponse.class));
                        if (modifyBuildHash) {
                            final TransportService.HandshakeResponse handshakeResponse = (TransportService.HandshakeResponse) response;
                            channel.sendResponse(
                                new TransportService.HandshakeResponse(
                                    handshakeResponse.getVersion(),
                                    handshakeResponse.getBuildHash() + "-modified",
                                    handshakeResponse.getDiscoveryNode(),
                                    handshakeResponse.getClusterName()
                                )
                            );
                        } else {
                            channel.sendResponse(response);
                        }
                    }
                    @Override
                    public void sendResponse(Exception exception) throws IOException {
                        channel.sendResponse(exception);
                    }
                }, task);
            } else {
                return actualHandler;
            }
        }
    }
}