The student stated an intent to harass the teacher, with the intent of causing alarm and distress. You can see she achieved it! Harassment is a hate crime and further the educational institution has an Equality Act requirement to support the teacher.
Saying 'had I known you were x I wouldn't have done the course and I am going to complain' does not pass the threshold for harassment, so what charge would you lay against the student?
Adults are allowed to leave a course for whatever reason they wish, it doesn't count as harassment.
It's so sad that people can't see beyond their own prejudices to even care. Try imagining this teacher is black, student turns up, recoils in horror and says "I won't be in your class because you're black, I'm going to complain I wasn't told, you should lose your job because you're black." Get it now?
Which of my posts indicates I don't care? I have supported OP. If an adult left a course saying ''had I known you were black I wouldn't have done the course and I am going to complain", it would not count as harassment because again, adults are allowed to leave a course for whatever reason they wish, it doesn't count as harassment.
You don't understand the law so are falling on tired old cliches. Get it now?