Without going into much detail about my experiences, it turns out this scenario stemmed from them being bipolar. Anecdotally, when they got diagnosed and treated, this behavior stopped and they were able to express frustration without going full manic. (I don't fully understand bipolar'isms that well myself, btw.)
It's OK for someone to be frustrated. It's OK for someone to get mad at you on occasion. It is not OK to be yelled at for hours over something absolutely trivial.
Don't jump to any conclusions if you are in a similar situation. The person may actually be abusive!