That would explain why I've been using dreams as a sort of indicator of progress for my time in therapy and working through my anxiety and depression. Certain things I've been anxious or angry about and held on to have been 'resolved' symbolically in dreams leaving me to feel a bit lighter upon waking up. Also just in general my nightmares have gotten less, the more I've been able to work through anxiety.
What you are saying is pretty much in line with what Matthew Walker is presenting as a hypothesis for the role of dreams in his book "Why we sleep". I have no training in the field, nor am I particularly well read on the topic, but I thought you might like a confirmation that this is not just an anecdote.