Sudden night time screaming

My almost 6-year-old son, who has autism, has been able to self-soothe to sleep for 3.5 years and has always slept through the night. But recently, he started waking up in the middle of the night, screaming at the top of his lungs, and hitting the walls. I go in to comfort him, but he keeps screaming, kicking, and hitting.

About a week into this, he developed a cough and wasn’t feeling well. He was diagnosed with bronchitis and put on antibiotics and steroids. That week, he was really aggressive (presumably from the steroids) and still waking up at night, screaming, kicking, and hitting the walls.

As he started to feel better, it seemed like his sleep was improving, but shortly after, the nighttime screaming started all over again. I took him back to the doctor, and they found he had double ear infections. He went on another round of antibiotics and finished them a few days ago.

Now, he doesn’t seem sick—no other symptoms during the day, and he’s fine when awake. But at night, the screaming and kicking continue. Even when I’m in the room with him, either putting him to bed or trying to comfort him during the night, he still screams and kicks. That makes me think it isn’t behavioral or attention-seeking.

I’ve scheduled an appointment with his primary care physician this week since the previous visits were at urgent care. I’ve heard that kids with autism can develop sleep problems, but could this happen so suddenly after years of sleeping well? Does this sound like it might still be medical, even though it’s only happening at night?

I feel so lost. Any advice would be appreciated.

TL;DR: My almost 6-year-old autistic son, who has always been a great sleeper, recently started waking up at night screaming, kicking, and hitting the walls. He had bronchitis (treated with antibiotics and steroids) and later double ear infections (treated with antibiotics), but now he seems fine during the day. Despite this, the nighttime episodes continue, even when I’m in the room with him. Could this be related to autism, a medical issue, or something else? I’m feeling lost and would love advice.