I have terrible vivid nightmares now and again during pregnancy (some related to baby/birth but not all). It's probably subconscious anxiety or worries. I notice that I less likely to get these dreams when I go to bed after an especially good day or in a positive vibe. Try going to sleep with happy thoughts 😊