It is unusual for them to actually take the child from the school but they can interview the child any time and anywhere they want. If the child is suspected of committing an offense, then the child can be arrested. If the child is suspected of being an abuse victim, then they can do what they need to do to protect the child. It is unfortunate that your child was so scared but you can help ease your child's mind by reassuring her that CPS is like police - and they are looking out for your child's best interests and she is safe with CPS.
As far as school notification, talk to the school about why they did not notify you. Perhaps they were instructed not to. If not, then I would advise them that you expect to be notified any time your child is to be taken by the school and by whom - and to ensure that they obtain a copy of the driver's license of the person taking the child. You do have the right to be assured that your child is not being kidnapped and is safe.