Those comments are unsettling for a parent to hear, and I am sorry.
A child psychiatrist or a neuropsychiatrist evaluation would be helpful. Maybe your pediatrician could give you a referral. If not, often these doctors have an association with a children's hospital.
The person you saw thought your child had anxiety, and anxiety untreated can cause a child to say things like that.
But so can a lot of other issues: anxiety, ADHD, Aspergers, or even a form(s)of a depression.
You will need to take your child to a medical specialist to sort it all out, and a good one will look at the entire picture: cognitive, emotional, physical, social etc.