Best of luck with this. My 6 year old sometimes lashes out for seemingly no reason. It's normally when there are serious issues underneath that he has not shown or expressed. It's only after it comes to a head and he either explodes or cries that we find out what the real trigger is. It's normally as a result of anxiety, perfectionism, feeling he is not heard, worry over something he cannot control or change (death, world issues, parents arguing, bad news from friends etc) and lack of mental stimulation.
Those are our main triggers, and even knowing them and recognising the signs most of the times I still sometimes get caught out and we have him hitting his little brother or me.
Punishment doesn't help - it's not something he can always control - in fact he is excellent at controlling himself when its not about one of the above reasons. We are trying to teach him coping skills. Because he is still so young that mostly means I am his safe place and for now I provide the coping skills almost by proxy while he is trying to learn and remember them.
In your situation you may want to consider keeping him home the rest of the year - let him have a bit of relaxing down time with you alone, with no mention of school anything. loads of physical play time, chance to talk without worry of anything etc. You may find out that way what he is worrying about.
It's so hard and mostly I just wanted to say good luck!