During desired nodes updates the system validates that the provided node settings are valid in order to avoid boot looping issues. If one of the node settings depends on a secure setting, the validation fails even when the secure setting is present and correct.
server/src/test/java/org/elasticsearch/action/admin/cluster/desirednodes/TransportUpdateDesiredNodesActionTests.java
final Metadata.Builder metadataBuilder = Metadata.builder();
        boolean containsDesiredNodes = false;
        if (randomBoolean()) {
            containsDesiredNodes = randomBoolean();
            final DesiredNodesMetadata desiredNodesMetadata = containsDesiredNodes
                ? new DesiredNodesMetadata(randomDesiredNodes())
                : DesiredNodesMetadata.EMPTY;
            metadataBuilder.putCustom(DesiredNodesMetadata.TYPE, desiredNodesMetadata);
        }
        final ClusterState currentClusterState = ClusterState.builder(new ClusterName(randomAlphaOfLength(10)))
            .metadata(metadataBuilder)
            .build();
        final UpdateDesiredNodesRequest request;
        final boolean updateSameHistory = containsDesiredNodes && randomBoolean();
        if (updateSameHistory) {
            
            final DesiredNodes desiredNodes = DesiredNodes.latestFromClusterState(currentClusterState);
            final List<DesiredNode> updatedNodes = randomSubsetOf(randomIntBetween(1, desiredNodes.nodes().size()), desiredNodes.nodes())
                .stream()
                .map(DesiredNodeWithStatus::desiredNode)
                .toList();
            request = new UpdateDesiredNodesRequest(desiredNodes.historyID(), desiredNodes.version() + 1, updatedNodes, false);
        } else {
            request = randomUpdateDesiredNodesRequest();
        }
        final ClusterState updatedClusterState = TransportUpdateDesiredNodesAction.replaceDesiredNodes(
            currentClusterState,
            TransportUpdateDesiredNodesAction.updateDesiredNodes(DesiredNodes.latestFromClusterState(currentClusterState), request)
        );
        final DesiredNodesMetadata desiredNodesMetadata = updatedClusterState.metadata().custom(DesiredNodesMetadata.TYPE);