I do agree that your Dd's ethnicity is always relevant.
It sounds as if there are serious issues with the school as a whole.
OK I will be very clear and blunt rather than second guess. I hope I do not offend anyone.
I have 3 times witnessed extreme friction between members of the African-Caribbean community and people who have come here from African countries. In one of these the word tribal almost led to violence. I am well aware of ongoing tension amongst some, a minority, of people from these different groups, and it is of course caused and fuelled by the worst of history.
It is quite ;possible that a child be discriminated against (unconscious bias) for being black / mixed race, yes, it still happens in schools, there was an obvious example shown on screen in the recent Grammar Schools series on Tv. It is also possible for a child to use this form of insult against a teacher (as it sounds as if yours did) , and for a teacher to engage in inter-community prejudice or discrimination.
As others have said, she should not have faced repeated and cumulative punishments for a single incident.
A teacher should NEVER have said those things before this all started and I am amazed that you would not have pursued a formal complaint through every possible channel.
I would start with finding out the school's version of why the repeated punishments occurred but have a statement of everything that has happened which is relevant.
Is it possible for your child to change schools?