Your daughter's problem is minor, but over time it can certainly cause a rift between her and her teacher. A teacher who is overly bothered by a little innocent chatter can seem insensitive, but when you consider the fact that she has to be aware of the needs of 20 to 25 children at the same time, it is easy to understand her concern. I see no likelihood that inappropriate talking to other children can lead to learning problems. But it can lead to chronic annoyance on the teacher's part. It can also cause other children to resist sitting by or playing with her, as they might be afraid of getting into trouble.
Hopefully you and her teacher can work on this together. If the teacher hasn't already tried this, suggest that she move your daughter's desk to a part of the room where she can't talk to other children during formal teaching/learning time. After a few days of having to sit where she can't talk to or disturb the other children, the teacher could move her desk back to where it was originally and let her have another chance. At that time your daughter should be praised for having kept quiet at a distance and given encouragement that she can manage without talking out of turn when in her regular position. The desk can be moved back and forth as necessary until the problem improves. And be sure to compliment her if and when you learn that she has moved back among the other children and is not disturbing them by too much talking.
At home, make her conscious of polite speech: we must talk one at a time. That seems to be a hard lesson to learn, judging from how often even grown-ups interrupt or break in on one another in conversation.
Our parenting advice is given as suggestions only. We recommend you also consult your healthcare provider, and urge you to contact them immediately if your question is urgent or about a medical condition.