Im going to take a different approach from the other posters and suggest that the teachers comment could be perversely positive.
At its root, the comment shows the teacher is at least aware that your child is dialing in effort relative to potential, and sees that as being problematic. That alone is light years ahead of most teachers, who seem surprised that gifted kids arent delighted to move in lockstep to the prescribed drudgery of age-linked work. Perhaps its tactless, and it could be conflating laziness with withdrawal, but its a step in the direction of awareness of gifted needs. Use that toehold to your advantage! Listen carefully, ask questions about what the teacher is observing, and sit with the feedback before providing a solution. The answer may be in the feedback. And if it isnt, youll be armed to respond because you hauled in the teachers perspective.
Best of luck! Let us know how it goes.
(One little note: Id want to be clear about how the teacher is labelling my child and communicating those perceptions directly to the child. Teachers comments, by dint of the authority behind them, carry outsized weight in childrens minds.)