I am wondering why when setting the value of a nested dictionary, the containing dictionary does not reflect those changes? On line3, is a copy of the dictionary being retur
Yes, in swift structs are passed by value not reference. In other words, you are getting a copy, with the same values. As I understand it, it actually does some optimization under the hood, whereby it doesn't actually make the copy until you change something. Regardless, what you get is a separate instance of the dictionary.
Same thing goes for arrays.