A dream is a succession of images, ideas, emotions, and sensations that usually occur involuntarily in the mind during certain stages of sleep. From Wikipedia
Showrunner Allan Heinberg emphasizes the ending was mapped out in 2022 long before any misconduct allegations surfaced.