oh my god, that is TERRIFYING. I feel like I tend to have nightmares when my body’s trying to wake me up for some reason (usually because I have to pee)—so maybe being in pain has the same effect? still no excuse for your brain being a jerk, though.
I tend to have more lucid dreams when I’m “trying to wake up”, but when I’m in pain it’s always horrible nightmares. I’m pretty sure it’s just the fact that the pain has to go somewhere during sleep, so it gets translated into horrible painful things happening to me.