OP, sorry that your kid’s teachers get her name mixed up.
I’m aware that what I’m about to say sounds pretty awful..... I’m a teacher, and I’ve always really struggled with names. I haven’t had this exact problem (my school doesn’t have many black pupils, so it would actually be quite hard to mix them up), but at the beginning of the year I do try and find one distinctive feature of a pupil to hang their name on e.g. A has really curly hair, B has freckles. So at the beginning of the year I could easily mix up names for pupils with similar features. This is most likely to happen with the youngest pupils as I find them harder to tell apart as they are a bit more reticent so you can’t tell them apart so easily by personality.
If your daughter is very much in a minority at her school because of her skin colour, then it is a distinguishing feature. So although annoying to her to be grouped together by race, it’s the same as mixing up two girls with ginger hair, or two boys with similar glasses. Everything else about they may be very different! I’m not saying this as an excuse really, but just as an explanation of how easily this can happen when you teach hundreds of pupils. I have to admit I’m surprised at it still happening at this time of year.
I would also say in my experience (of having mixed pupils up!), they remember that you did it FOREVER because to them it is rather offensive, but they don’t remember the time you did it to someone else s it just doesn’t have that personal impact, so it is possible there’s some element of bias in what they remember - although it might happen to them more often, I wouldn’t guarantee the teachers in question don’t mix up white pupils too!
(Big caveat - I don’t know the teachers in question. Just saying one way it could happen without being especially racist)