Why it's problematic:
On the surface, it may seem like a well-intended phrase, but its underlying history makes it questionable. When it comes to children of color this "compliment" stems from racist stereotypes suggesting people of color are unable to speak eloquently and only use slang. Noting a BIPOC (black, Indigenous, and people of color) child's speech is essentially telling them that they deviate from the norm because you assumed they wouldn't be able to speak well.
For the recipient of the compliment it translates to: "You sound really smart for a Black person" or "It's unusual for someone of your race to be that smart."