Firstly, there is no such thing as 'high functioning'... he is every bit as autistic as the next person on the spectrum... what it means is he is better at masking it, can expend more energy to do so.
But his brain is still an autistic brain, it processes information differently.
When he hit on 'you are brown like poo' his point of reference was 'poo is yucky, poo is brown, you are brown ergo you are yucky'... No real difference than calling any other kid a poopoo head or a poo or a big smelly poo face... etc.
And then YOU (parents, teachers) told him that actually referencing brown as a bad thing was FAR more powerful than simply calling someone a poo head.
Instead of learning that thats an awful thing to do because of all of the complex reasons racism is awful, which he can't comprehend really even if he wasn't autistic... what HE learned was 'this is a REALLY powerful way to hurt someone and cause a huge fuss when I am very very angry'.
You effectively gave him that tool, because you don't really understand how the autistic brain works.
He doesn't yet (and most kids at that age don't really, they mimic it for the sake of those pushing for it) have a fully developed sense of empathy, and being autistic means he may never really grasp how other people feel.
So you have to find another way around it, that he can understand and do, even if he doesn't feel it.
A big start will be understanding why high functioning is a bad concept as far as autism goes - I suspect it is causing you to expect him to be capable of more than he really is at times.