Several points I want to make. First some interview panels make people feel they are going to get hired without intending to. I have been on interviews where I was sure they loved me only to not get the job and I have been on interviews where an offer was made when I felt they were not interested throughout the interview. So you can't base the final result solely on your impression of how the interview went. It is entirely possible they loved the next guy they interviewed even more or that they decided not to offer the job to anyone.
However, what they did sounds as if it could be discrimination. But if it is really what action would you want to take? Do you really want to work for people who are afraid to hire you because you asked a question? Do you really want to work for people of such low moral character that they care what color your skin is? What would your day-to-day work life be like if you sued them for discrimination and won?
I have faced blatant discrimination in my over 30 years in the workplace. I had one man flat out tell me he would under no circumstances hire a woman and he was interviewing me only because HR said he had to. That made me furious and upset, but after I calmed down I realized that I didn't want to work for him any more than he wanted to me to work for him. I have also worked for people who hated having a woman work for them and made it clear I was less than any man on the team. That is pretty unpleasant to deal with daily. Yes being female or Black or gay or Muslim or disabled or all sorts of other things could limit your job prospects and that truly is unfair. But life is unfair.
Some of us will push the envelope and sue to get those positions. I have known a few of them through the years and they were disliked at work and many people did nasty things to them and the daily grind for them must have been unpleasant at best. If you have the courage to deal with that, then go ahead and pursue a suit. We need people willing to do this. But it comes at a steep price in my experience. Me, I'd rather find someone who actually wants to hire me without having to force the issue.
I have also known a few people who cried discrimination every time they didn't get what they wanted. I suspect that your question made them feel as if you might be this kind of person (from what you wrote, I don't think that, but that type of question would tend to make an interview panel uneasy.). Not all choices of other people for positions or promotion are discrimination and thinking you are being discriminated against every time you don't get a job or a promotion is also career limiting. It is career limiting because you don't try to fix the actual thing that is holding you back. It is career limiting because people will talk about how you didn't want to be qualified but chose to sue instead. People won't recommend you, they won't tell you about upcoming opportunities.
Why am I saying all this? I guess because I want you to feel better about things. Sometimes it is best to just move on and not dwell on how they did you wrong. It sounds as if you are well-qualified. A better job will come along. With people you will be proud to work with because they won't care if you are Black or purple or pink with yellow polka-dots. In the long run, wouldn't that make you happier? Does staying angry and hurt at the rejection help you in any way?