Yes, I thought about both possibilities (discrimination and insecurity) but I want to remain positive and not attribute ulterior motives to the interviewer. It was an ironic experience though because, I believe, had my code been a bit slower I would have had a better shot at the interview.
Or the interviewer felt insecure and threatened by their competence. If that's the case, they dodged a bullet.
Either way, I hope you've found a good place to share your skills since that experience. Wishing you the best