That’s not accurate. One leading hypothesis is that the experience of dreaming is a side effect of memory processing and consolidation[1]. Using the name of a side effect to describe the process that produces it is misleading, and at best it goes well beyond what’s actually known.
[Edit: and the side effect in question, dreaming, is closely tied to consciousness in humans. Using an “analogy” with those connotations is an unfortunate mistake.]
[1] “The process of memory reactivation and consolidation in the sleeping brain appears to influence conscious experience during sleep, contributing to dream content recalled on awakening.” — https://pmc.ncbi.nlm.nih.gov/articles/PMC4704085/