All of that might be attributed to his own self-consciousness if it weren't for the fact that he was deferential to male engineers in code review, and during the height of the tension with me, during scrum he started openly criticizing/mocking a female contractor's work (on an entirely unrelated project that he knew very little about).
This is a pretty egregious example, but I could imagine that a much subtler version happens more often (possibly it's happened to me but it seems more pragmatic to assume it's not related to sexism if at all possible).
In my home country I'm part of the racial majority. In my adopted country, I'm a racial minority and I've worked in offices both places. I've experienced bullying in my home country and racism in my adopted country and it really doesn't feel any different to me. If someone is targeting you for abuse, it doesn't really matter what the reason is. I wish both were recognised as being inappropriate in the workplace.
Can you give us a sample interaction that concretizes this, if it doesn't compromise the anonymity of you, this individual, or your company? I think some men can fall prey to perpetrating this even subconsciously, and it could be very useful for a lot of people, myself included, to see an example.