
Found the answer:
Replaced “foreach($term in $termSet.Terms)”Â
with
 foreach($term in $termSet.GetAllTerms())Â
This maybe documented somewhere–but what happens is that $termSet.Terms only goes through the first row and it will never find the matching guid and complete without creating the third level.
