I don't know how often I have had the experience of waking from a dream and seeing some object like a cup or tool or even a person and as I reach out or even walk over to approach the imagined person they just vanish from thin air. What if a person can be in a state where not all of their cognitive circuits have awakened or better yet interpret the episodic events happening as a dream but they are actually are not. There is a condition known as parasomnia and somnambulism where sleep-walking-like states of individuals become violent, here is a very good
paper on the subject. When researching the
neural correlates of dreaming I found that REM sleep has activations that are similar to wakefulness! The image below shows what areas of the brain increase in activity and decrease as well during REM sleep.
There is another phenomenon called
Dream-Reality confusion which aligned with psychotic symptoms! But I don't think all dream-reality confusion derives from a disorder. As I mentioned earlier there could cognitive circuits that are placed into a condition where the brain is in a dream state in fact the person hasn't fully awakened. Where actions that otherwise would be inhibited or corrected by such circuits don't and the person acts out a ridiculous act that could be harmful to themselves or others. This could explain how mass shootings happen. Imagine acting out by shooting people at random, your brain would normally stop such an action but those circuits are shut down as if in a dream. Then imagine that those circuits eventually do turn back on and you are now fully cognizant of what you've done and realized there's no way to turn things around, you're confused as to how you could have even committed such an act and then take the quick way out and kill yourself!
I then realized a danger for an AGI to have the ability to dream. Because such an AI would have many computational components and they would operate asynchronously and in parallel ensuring that the AGI doesn't become ambulatory while dreaming could get tricky and have similar problems distinguishing dreams from reality, which then could become very dangerous. Think of a bodyguard or a military soldier bot that needs to optimize or fine-tune its defense strategies, it engages in its dream state killing anyone or thing that could be a threat or even some kind of companion bot that is working out some conflict or reprimand that it experienced. Those kinds of scenarios can have violent behaviors and the bot acts them out in dreams but would never do so in its wakeful state, at least if it knows it's awake.
I highly recommend reading the links I've placed in this post, you won't be disappointed.