Friendship is not a free pass to treat another person badly.
Relationships of all kinds take a lot of effort, and it is inevitable that we are all going to make mistakes sometimes. Starting an argument in a moment of frustration or accidentally saying or doing something that manages to offend is just a part of existing alongside other people. The measure of who we are as a relative, partner, or friend is how we react to these kinds of situations.
Part of maturing is realizing which relationships are worth keeping around after conflict, and which are not going to add anything of value to our lives once people show us who they are through a disagreement. Even with experience, it is not always an easy judgment call to make. Some individuals feel entitled to display the most outrageous behavior because they think that their supposed closeness to you will allow them to get away with it, but that is not always the case.
The problem that comes from cutting off unpleasant people is that they usually do not make the process easy. The less experienced you are in dealing with this scenario, the more impactful it can be on you.