Most dreams (especially nightmares) have deep reasonings for it. Nightmares can stem from your amygdala becoming overactive. Your amygdala is the small part of your brain that holds/controls negative emotions, thoughts, etc. So it's very possible that you have a fear (not necessarily a phobia) of others turning on you. The reaction of yours was you lashing out in anger and confusion.
I would recommend talking to someone personal that you trust about stressful moments/days as stress can be a contributor to becoming susceptible to nightmares and overpowering fears subconsciously. . Meditation, as stated before, is a great way to help control this.
Best of Blessings,