Sometimes you are unaware of how your actions are being perceived by others. You might think you are defending yourself, but in reality the other person is feeling attacked by your defense.
I recently had an experience where the more I defended my point of view, the more aggressive the other person became. And it took me a while to realize that from their point of view, me disagreeing with them was me attacking them. They felt I was invalidating their emotions and their perspective and disrespecting their right to have an opinion that is different from mine when that wasn’t my intention at all.
The approach I suggest you use next time is to utilize active listening to repeat back to them what they said to show that you heard them. Then check if they want to hear your opinion. Ask if they would listen to you now that you’ve listened to them. If the answer is no, then walk away, the conversation is done. If they do listen, then you can speak your mind. Manage the transitions from when you are listening and they are talking, to when you are talking and they are listening by making these transitions very clear. The last thing you want is for them to feel you are interrupting them to talk over them. Clarify if they have finished talking and ask for permission before transitioning to you talk.
In summary, if you are defending your position without acknowledging them, they could feel attacked. The way to have a healthy conversation is to use active listening to show you heard them, and then explicit transitions with consent from you listening and them talking to you talking and them listening so both people are respected and clear on their roles in the conversation at all times.