That example reminded me of dreaming. Whatever random elements come up in a dream, my mind finds a way to rationalize them as making sense. (At least until I awake and realize that it was nonsense.)
That's mainly because activity in the prefrontal cortex is very low - that's the part of the brain that handles problem solving, comprehension etc. and reasoning.