diff --git a/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php b/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php
index b765b05..f98d813 100644
--- a/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php
+++ b/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php
@@ -132,14 +132,6 @@ protected function validateNode(TypedDataInterface $data, $constraints = NULL, $
     $value = $this->typedDataManager->getCanonicalRepresentation($data);
     $this->context->setNode($value, $data, $metadata, $property_path);
 
-    if (isset($constraints) || !$this->context->isGroupValidated($cache_key, Constraint::DEFAULT_GROUP)) {
-      if (!isset($constraints)) {
-        $this->context->markGroupAsValidated($cache_key, Constraint::DEFAULT_GROUP);
-        $constraints = $metadata->findConstraints(Constraint::DEFAULT_GROUP);
-      }
-      $this->validateConstraints($value, $cache_key, $constraints);
-    }
-
     // If the data is a list or complex data, validate the contained list items
     // or properties. However, do not recurse if the data is empty.
     if (($data instanceof ListInterface || $data instanceof ComplexDataInterface) && !$data->isEmpty()) {
@@ -148,6 +140,14 @@ protected function validateNode(TypedDataInterface $data, $constraints = NULL, $
       }
     }
 
+    if (isset($constraints) || !$this->context->isGroupValidated($cache_key, Constraint::DEFAULT_GROUP)) {
+      if (!isset($constraints)) {
+        $this->context->markGroupAsValidated($cache_key, Constraint::DEFAULT_GROUP);
+        $constraints = $metadata->findConstraints(Constraint::DEFAULT_GROUP);
+      }
+      $this->validateConstraints($value, $cache_key, $constraints);
+    }
+
     $this->context->setNode($previous_value, $previous_object, $previous_metadata, $previous_path);
 
     return $this;
diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
index 5e3558e..878c3cd 100644
--- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
+++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php
@@ -170,19 +170,19 @@ public function testPropertiesValidateWithMultipleLevels() {
     $violations = $this->recursiveValidator->validate($typed_data);
     $this->assertCount(6, $violations);
 
-    $this->assertEquals('violation: 3', $violations->get(0)->getMessage());
-    $this->assertEquals('violation: value1', $violations->get(1)->getMessage());
-    $this->assertEquals('violation: value2', $violations->get(2)->getMessage());
-    $this->assertEquals('violation: 2', $violations->get(3)->getMessage());
-    $this->assertEquals('violation: subvalue1', $violations->get(4)->getMessage());
-    $this->assertEquals('violation: subvalue2', $violations->get(5)->getMessage());
-
-    $this->assertEquals('', $violations->get(0)->getPropertyPath());
-    $this->assertEquals('key1', $violations->get(1)->getPropertyPath());
-    $this->assertEquals('key2', $violations->get(2)->getPropertyPath());
-    $this->assertEquals('key_with_properties', $violations->get(3)->getPropertyPath());
-    $this->assertEquals('key_with_properties.subkey1', $violations->get(4)->getPropertyPath());
-    $this->assertEquals('key_with_properties.subkey2', $violations->get(5)->getPropertyPath());
+    $this->assertEquals('violation: value1', $violations->get(0)->getMessage());
+    $this->assertEquals('violation: value2', $violations->get(1)->getMessage());
+    $this->assertEquals('violation: subvalue1', $violations->get(2)->getMessage());
+    $this->assertEquals('violation: subvalue2', $violations->get(3)->getMessage());
+    $this->assertEquals('violation: 2', $violations->get(4)->getMessage());
+    $this->assertEquals('violation: 3', $violations->get(5)->getMessage());
+
+    $this->assertEquals('key1', $violations->get(0)->getPropertyPath());
+    $this->assertEquals('key2', $violations->get(1)->getPropertyPath());
+    $this->assertEquals('key_with_properties.subkey1', $violations->get(2)->getPropertyPath());
+    $this->assertEquals('key_with_properties.subkey2', $violations->get(3)->getPropertyPath());
+    $this->assertEquals('key_with_properties', $violations->get(4)->getPropertyPath());
+    $this->assertEquals('', $violations->get(5)->getPropertyPath());
   }
 
   /**
@@ -276,13 +276,13 @@ public function testValidateProperty() {
     $violations = $this->recursiveValidator->validateProperty($typed_data, 'key_with_properties');
     $this->assertCount(3, $violations);
 
-    $this->assertEquals('violation: 2', $violations->get(0)->getMessage());
-    $this->assertEquals('violation: subvalue1', $violations->get(1)->getMessage());
-    $this->assertEquals('violation: subvalue2', $violations->get(2)->getMessage());
+    $this->assertEquals('violation: subvalue1', $violations->get(0)->getMessage());
+    $this->assertEquals('violation: subvalue2', $violations->get(1)->getMessage());
+    $this->assertEquals('violation: 2', $violations->get(2)->getMessage());
 
-    $this->assertEquals('', $violations->get(0)->getPropertyPath());
-    $this->assertEquals('subkey1', $violations->get(1)->getPropertyPath());
-    $this->assertEquals('subkey2', $violations->get(2)->getPropertyPath());
+    $this->assertEquals('subkey1', $violations->get(0)->getPropertyPath());
+    $this->assertEquals('subkey2', $violations->get(1)->getPropertyPath());
+    $this->assertEquals('', $violations->get(2)->getPropertyPath());
   }
 
   /**
@@ -305,13 +305,13 @@ public function testValidatePropertyValue() {
     $violations = $this->recursiveValidator->validatePropertyValue($typed_data, 'key_with_properties', $typed_data->get('key_with_properties'));
     $this->assertCount(3, $violations);
 
-    $this->assertEquals('violation: 2', $violations->get(0)->getMessage());
-    $this->assertEquals('violation: subvalue11', $violations->get(1)->getMessage());
-    $this->assertEquals('violation: subvalue22', $violations->get(2)->getMessage());
+    $this->assertEquals('violation: subvalue11', $violations->get(0)->getMessage());
+    $this->assertEquals('violation: subvalue22', $violations->get(1)->getMessage());
+    $this->assertEquals('violation: 2', $violations->get(2)->getMessage());
 
-    $this->assertEquals('', $violations->get(0)->getPropertyPath());
-    $this->assertEquals('subkey1', $violations->get(1)->getPropertyPath());
-    $this->assertEquals('subkey2', $violations->get(2)->getPropertyPath());
+    $this->assertEquals('subkey1', $violations->get(0)->getPropertyPath());
+    $this->assertEquals('subkey2', $violations->get(1)->getPropertyPath());
+    $this->assertEquals('', $violations->get(2)->getPropertyPath());
   }
 
   /**
