Thats a tough one. Ds has very rigid thinking about 'fairness' and 'routine' and that really was a double whammy for your ds. It sounds similar to something that could happen in school too, whole class punishments. (which to me means lazy teaching, if you cannot identify which children are being disruptive!)
However i suppose its something they do have to deal with. I try to teach ds that sometimes life isn't fair and that is ok, its not a big deal, a bit like losing, sometimes you win, sometimes you lose. Making 'mistakes' and getting things 'wrong' is also a real big deal for ds.
Firstly I have been modelling the behaviour, when things go 'wrong', its oh never mind, its no big deal.
We play lots of games and when ds or I lose 'oh never mind, good game, well played etc'
with lots of praise when ds models a more appropriate response, instead of a meltdown.
Maybe you tell/show him a more appropriate response, maybe some role play and then reward him, if he manages a more appropriate response? ie two biscuits and squash as soon as you get home or a packet of sweets or something desirable to him?