diff --git a/lib/puppet/pops/types/type_mismatch_describer.rb b/lib/puppet/pops/types/type_mismatch_describer.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/pops/types/type_mismatch_describer.rb
+++ b/lib/puppet/pops/types/type_mismatch_describer.rb
@@ -796,7 +796,7 @@ module Types
     def describe_PTypeAliasType(expected, actual, path)
       resolved_type = expected.resolved_type
       describe(resolved_type, actual, path).map do |description|
-        if description.is_a?(ExpectedActualMismatch)
+        if description.is_a?(ExpectedActualMismatch) && description.path.length == path.length
           description.swap_expected(expected)
         else
           description
(PUP-<I>) Fix error when formatting errors for TypeAliases with variants

The TypeFormatter would incorrectly swap the expected type in
a description for the original alias although the message description
was for something nested contained in the resolved type of the alias.

This commit ensures that the replacement only happends when the sizes
of the path to the error description are equal.