Freud was right in assuming that some dreams have meaning. But other dreams occur randomly, as in a kaleidoscope. Each of our brain’s 81 billion neurons can interact with 110 trillion or more synapses or connections in multiple random fashion. Therefore, not all dreams have meaning. If they are misinterpreted as meaningful, then they function as self-indoctrination.
On the other hand these gazillions of interactions can produce novel and creative ideas. Various inventors have alleged that their creations or ingenious ideas have been occasioned by their dreams.