Thank you for your query. I am sorry for the delay in responding to your query.
is a habit and no medicine is known to cause it.
If your daughter is not comfortable with the mediciations then it is advisable to get her re-examined by the doctor and even a child psychologist
who will be in a better position to assess her and guide her. Re-examination may find a cause for the pain in the neck and your daughter managed appropriately.
I hope I have answered your query to your satisfaction.
Wishing your daughter all the best.