diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php
index 1181953..8c2f6e01 100644
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -171,9 +171,14 @@ protected function getDefinitionWithReplacements($base_plugin_id, array $replace
       // Replace dynamic portions of the definition type.
       if (!empty($replacements) && strpos($definition['type'], ']')) {
         $sub_type = $this->determineType($this->replaceName($definition['type'], $replacements), $definitions);
+        $sub_definition = $definitions[$sub_type];
+        if (isset($definitions[$sub_type]['type'])) {
+          $sub_merge = $this->getDefinition($definitions[$sub_type]['type'], $exception_on_invalid);
+          $sub_definition = NestedArray::mergeDeepArray([$sub_merge, $definitions[$sub_type]], TRUE);
+        }
         // Merge the newly determined subtype definition with the original
         // definition.
-        $definition = NestedArray::mergeDeepArray([$definitions[$sub_type], $definition], TRUE);
+        $definition = NestedArray::mergeDeepArray([$sub_definition, $definition], TRUE);
         $type = "$type||$sub_type";
       }
       // Unset type so we try the merge only once per type.
diff --git a/core/modules/config/src/Tests/ConfigSchemaTest.php b/core/modules/config/src/Tests/ConfigSchemaTest.php
index a89db0e..c5b676f 100644
--- a/core/modules/config/src/Tests/ConfigSchemaTest.php
+++ b/core/modules/config/src/Tests/ConfigSchemaTest.php
@@ -636,6 +636,24 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets() {
     $this->assertEqual($definition['type'], 'wrapping.test.double_brackets.*||test.double_brackets.cat.dog');
     $definition = $tests[1]->getDataDefinition()->toArray();
     $this->assertEqual($definition['type'], 'wrapping.test.double_brackets.*||test.double_brackets.turtle.horse');
+
+    $typed_values = [
+      'tests' => [
+        [
+          'id' => 'cat:persion.dog',
+          'foo' => 'cat',
+          'bar' => 'dog',
+          'breed' => 'persion',
+        ],
+      ],
+    ];
+
+    \Drupal::configFactory()->getEditable('wrapping.config_schema_test.other_double_brackets')
+      ->setData($typed_values)
+      ->save();
+    $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.other_double_brackets')->get('tests')->getElements();
+    $definition = $tests[0]->getDataDefinition()->toArray();
+    $this->assertEqual($definition['type'], 'wrapping.test.other_double_brackets.*||test.double_brackets.cat:*.*');
   }
 
 }
diff --git a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
index f96bb8b..c10e268 100644
--- a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
+++ b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml
@@ -270,3 +270,30 @@ test.double_brackets.turtle.horse:
 
 test.double_brackets.*:
   type: mapping
+
+wrapping.config_schema_test.other_double_brackets:
+  type: config_object
+  mapping:
+    tests:
+      type: sequence
+      sequence:
+        - type: wrapping.test.other_double_brackets.[id]
+
+wrapping.test.other_double_brackets.*:
+  type: test.double_brackets.[id]
+  mapping:
+    id:
+      type: string
+    foo:
+      type: string
+    bar:
+      type: string
+
+test.double_brackets.cat:*.*:
+  type: test.double_brackets.breed
+
+test.double_brackets.breed:
+  type: test.double_brackets
+  mapping:
+    breed:
+      type: string
