When executing the simulate template API, a number of default settings are collected and merged with the resulting template settings. Unfortunately, these defaults are merged out of order and thus the simulated template result's settings are being written out as the defaults instead of their actual values.
server/src/main/java/org/elasticsearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java
* Take a template and index name as well as state where the template exists, and return a final
     * {@link Template} that represents all the resolved Settings, Mappings, Aliases and Lifecycle
     */
    public static Template resolveTemplate(
        final String matchingTemplate,
        final String indexName,
        final ClusterState simulatedState,
        final boolean isDslOnlyMode,
        final NamedXContentRegistry xContentRegistry,
        final IndicesService indicesService,
        final SystemIndices systemIndices,
        Set<IndexSettingProvider> indexSettingProviders
    ) throws Exception {
        var metadata = simulatedState.getMetadata();
        Settings templateSettings = resolveSettings(simulatedState.metadata(), matchingTemplate);
        List<Map<String, AliasMetadata>> resolvedAliases = MetadataIndexTemplateService.resolveAliases(
            simulatedState.metadata(),
            matchingTemplate
        );
        ComposableIndexTemplate template = simulatedState.metadata().templatesV2().get(matchingTemplate);
        
        Settings.Builder dummySettings = Settings.builder()
            .put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current())
            .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
            .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
            .put(IndexMetadata.SETTING_INDEX_UUID, UUIDs.randomBase64UUID());
        
        List<CompressedXContent> mappings = MetadataCreateIndexService.collectV2Mappings(
            null,
            simulatedState,