Should I avoid this guy who has a girlfriend even though he may have feelings for me?

I have feelings for someone who has a girlfriend. We used to message each other (nothing weird it was normal and friendly ) until his girlfriend discovered he was messaging me and made him unfollow me. He told me what happened and then we agreed to stay friends, but he started acting weird around me. Some people around us at work noticed how we are always talking and sometimes argue, and say that we both have feelings for one another. One week he is attentive and friendly, and the next he is cold and ignores me. Recently he pretty much snapped at me, and I told him how I felt he was sometimes rude to me and I didn’t like it. He reminded me he has a girlfriend and that he feels like when I talk to him it’s just to talk negatively about others (which is not even true tf?) and it makes him uncomfortable. He told me he feels that I’m too comfortable with him and that he feels like he’s dating me by the way I “complain” to him and that I need to worry about myself. I took this as his way of saying he doesn’t want me to bother him anymore because of his girlfriend, but the strange thing is he just got mad at me out of nowhere and never really indicated that I was making him uncomfortable because he usually is open to talking to me and seems to enjoy talking to me most of the time. I respect the fact he has a girlfriend but I feel like if I tell him how bad he makes me feel he will just get upset and gaslight me like he sometimes does when we argue. Why did he only suddenly snap at me like this? And is it better if I just start avoiding him all together?
Should I avoid this guy who has a girlfriend even though he may have feelings for me?
Add Opinion