The "Knightmare" scene in "Batman V Superman: Dawn of Justice" was one of the highly criticized points of the movie.
There were some reviews that called it unnecessary and others mentioned that it was a shameless plug for the Justice League. It was also compared to the end-credits scene that Marvel's movies have.
In a Hall of Justice podcast, storyboard artist Jay Oliva reveals a different take-if not THE take on what the Knightmare "dream" sequences actually are. (h/t Screen Rant)
"What if what you saw was a Time Boom, a latent memory from the future when Flash comes back? If you look at the cut, he doesn't go to sleep! He's waiting for the [Lexcorp file decryption] and suddenly this [Knightmare sequence] comes in, and he's jogged out of it seeing his own death. And what does he see? He sees Flash. And if you're a DC fan, you know what's happening. You know that Flash going back in time, that memory is now coming back to him... mind you, it's jumbled," Oliva declared.
This sounds like a plausible explanation for the sequence and it also gives it relevance. The general, non-comic book reading public and even some movie critics would not have guessed the allusions, which is why Marvel placed the Thanos plugs outside of the movie. Of course, Warner could not imitate that.
Cinema Blend also threshes out the terminologies that Oliva used, pointing that a "Time Boom is a sort of temporal wave that radiates throughout the DC Universe once a moment in time has been changed."
By that definition, the Knightmare in "BvS" has The Flash travelling "back in time to warn Bruce Wayne of some dark times ahead" and according to Jay Oliva's theory, if it holds true, "this trip or another trip like it set off a shockwave through time that somehow leads up to Darkseid's arrival and Bruce Wayne's death at the hands of Superman."
Despite the position that Oliva holds, this is not an "official" explanation as Zack Snyder is definitely the man that calls the shots. This is one possibility that they have opened and could possibly explore but for Oliva, it's still just a theory.
Still, the possibility that the "Knightmare" is not just an empty dream sequence brings more credence to the movie that was heavily criticized. Perhaps the best way to view "Batman V Superman: Dawn Of Justice" is that it is not a complete work in itself, especially with all of the universe building that the film was tasked to carry. Thus, the Knightmare scene may be an actual "spoiler" to the Justice League movie.