I suspect that either approach can go wrong in its own way. If I identify my race and gender, it might go against the company's quota (assuming it exists). If I decline to answer, it may be perceived as if the candidate is not quite open and therefore may reduce trust.
I'll appreciate your perspective on this.