It’s explicitly forbidden for anyone to discriminate against you based on your race or ethnicity
Ironically, it’s very common to be asked for this information specifically because of anti-discrimination laws, so they can demonstrate statistically fair practices. I always see a box for this on medical forms, new-hire paperwork, etc. I believe the law requires it to be optional and only used for regulatory reports. So that’s probably what OP heard about.