If your DD wants to go to the STEM program and it is a good fit, I would not make her stay where she is because of swimming. If I were in her shoes, I'd be rather resentful if I was held back because of swimming.

On the other hand, I do know a family that decided against acceleration because of the child's exceptional athletic abilities and he did end up receiving a full athletic college scholarship.

Have you spoken to her coach about the possible consequences?