Previous research indicates elevated levels of clinically significant traits and symptoms of autism spectrum disorder and attention-deficit hyperactivity disorder (ADHD) in children with chronic pain, but associations with functioning and depression are yet unclear. The current study examined the relationships of autistic traits and ADHD symptoms with pain interference, depression, and health-related quality of life, as well as the mediating roles of insomnia and psychological inflexibility, in children with chronic pain (n = 146, 8–17 years, 102 girls) presenting at a tertiary pain clinic. Children completed measures of pain intensity, depression, pain interference, health-related quality of life, insomnia, and psychological inflexibility. Parents (n = 146, 111 mothers) completed measures to assess autistic traits and ADHD symptoms in their children. Children with clinically significant autistic traits and ADHD symptoms presented with significantly higher levels of depressive symptoms and pain interference, and significantly lower health-related quality of life, than did the other children. Autistic traits and ADHD symptoms contributed significantly to the prediction of pain interference and depressive symptoms, as well as health-related quality of life. Psychological inflexibility mediated the relationships between ADHD symptoms and autistic traits on the one hand and depression, pain interference, and health-related quality of life on the other, while insomnia mediated the relationships between ADHD symptoms and depression, pain interference, and health-related quality of life. All analyses were adjusted for demographics and pain intensity. Results suggest the utility of screening for neurodevelopmental disorders in children with chronic pain. Furthermore, the findings may indicate insomnia and skills related to psychological flexibility as potential treatment targets in interventions aiming at improving functioning and health-related quality of life in children with chronic pain and co-occurring symptoms of neurodevelopmental disorders.