Sometimes understanding, sometimes not
I find even my friends and relatives, at times, are very loose and inconsistent with their tolerance for my mental illnesses. It is my experience that they tend to switch between compassion and scorn on a whim. One moment someone will be understanding of a set of behaviours as a symptom of my conditions, then when addressing the same behaviours in another instant, they will treat me like I am a "bad person". I suppose there could be a series of factors that I am not considering, but the end result is their inconsistent behaviour is doing more harm. That being said, that kind of inconsistency is also a common symptom of certain mental illnesses. I myself am aware that my mental and emotional state can cause me to lash out and say some pretty hurtful things to people, and I go to a lot of effort to keep my behaviour and words in check. When I do lash out, I make sure to apologise and seek penance to rectify the situation. I feel like I am constantly apologizing for my mental illness. However, I tend to find the people in my life who are not diagnosed with mental illness seem to not be expected to keep themselves in check to the same degree. I don't know, I am just venting.
I've experienced this phenomenon both as the one with the mental illness being inconsistently tolerated/accommodated by friends and family, and as the friend/family member inconsistently tolerating it in another. The truth is that some mental illnesses place more demands on the others around us, and most people (myself absolutely included) can be all over the place in terms of how willing they are to accommodate that. Even something as simple as blood sugar (how recently have they eaten) can influence someone's behaviour towards us.
The fact that you are already reflecting on how your own behaviour might explain some of this inconsistency is a mature move on your part. I think if you are already comfortable apologizing to friends when you lash out, you can also talk honestly with them about your behaviour more generally, how you are aware of it, trying to work on it, etc.
That said, your friends and family of course deserve the same dignity and respect, and might be justified in reacting negatively to consistently abusive language.