I second the advice to read around autism, Aspergers and PDA (pathological demand avoidance).
Children with ASD, especially those who are more academically able, can be angelic in school and flip at home. Like butterfly says, this is because fitting in and getting everything right in school is exhausting and stressful, they can experience overwhelming sensory overload and they don't feel safe enough there to express their true emotions. This can lead to a loss of control when they get home and emotions that are really hard to manage on school nights.
Quite often these children don't have a good understanding of their own emotions and the root of them so, although they feel anxious, stressed, overloaded and/or exhausted, they aren't necessarily aware of it or aware of the reasons behind those feelings.
Because the root of the behaviour is distress, managing it with sanctions doesn't help. The patience you demonstrated last night was perfect but, if he does have an autism spectrum disorder, taking away his comfort object would have been unhelpful. It was removing a coping strategy and making an unexpected change which added to an already disrupted routine. This would make it harder for him to comply with your instruction to get ready for bed, not easier.
Go easy on yourself for getting angry. We're allowed to make mistakes and behaviour that you don't understand is impossible to manage and infuriating. You certainly don't deserve a flaming.
The strategies recommended for PDA are useful for lots of other children too.
Try to identify some triggers, e.g. unexpected (or expected) changes to routine, last minute changes to plans, busy or noisy environments, misinterpreting jokes or sarcasm, unexpected touches (people brushing past or bumping into him), going to unfamiliar places, people visiting the house, new foods or foods with textures he finds difficult.
Also try keeping to a very predictable undemanding routine for a while. Avoid surprises, visitors, new foods, changes in routine and make sure he knows what is happening in advance as much as possible to see if the more challenging behaviour diminishes.
That may all be very wide of the mark but it's well worth thinking about if you're at your wit's end, which you clearly are.