Most likely just mood swings/lability. As others have said, there are many reasons why. If you want to go the pathology route, you are gonna need to share more since off what you said that could be several different disorders(BPD, Cyclothymia, MDD, ADHD, and more you get the idea). I wouldn't go that route though lol, since it's probably just mood swings, and not worth fretting over possible causes that probably aren't even what it is.
It's kinda silly since the thought of suicide for many here is seen as oddly comforting, but I can imagine it's probably not pleasant when you were already feeling okay lol. I have similar swings, but it's usually just my manic transition, and it's definitely not as frequent as you make it out.
The swings aren't necessarily healthy, but mood swings, even extreme ones that jump to suicide, aren't that abnormal, and I think a lot of people here probably have experienced something similar. Still, it's unpleasant if it's souring your moods. There isn't really much you can do to stop it, but if you think it's getting worse, it could be from stress or burnout.
Anyways, am still sorry that you are suffering. Hope it improves, or at least stops coming up in such inconvenient times.