I have a child with autism who is now older.
the problem with punishment here is that your child may see this as simply a way to behave. My dc did this for a while.
so his mental model was - when I do something mum and dad don’t like they punish me and this is meant to stop he doing it.
so he applies this to himself - mum and dad are doing something I don’t like so I will punish them and they will stop doing it.
obviously it doesn’t work in either direction terribly well but when you have two sides both behaving like that it can escalate very very fast.
my dc was about ten when he started doing this and you might be surprised how deeply deeply unpleasant his “punishments” can be.
you are probably better off trying to work on identifying emotions (so he knows when he is angry) and teaching him better ways of interacting with people.
so for example one thing you could do is talk through reasons for something so that he doesn’t get angry at srbitrary rules.
so for example - we don’t eat and drink in the bedrooms because it makes a mess and then it needs to be cleaned up. The kitchen and dining room get messy during dinner time and mummy has to clean that up.
then if he says about wanting food upstairs you repeat again WHY the rule is in place, and maybe offer an alternative (would you like your snack in the garden? It doesn’t matter if that gets messy)
this won’t fix things immediately (nothing will) but it helps build up reasons why people do things (which helps with theory of mind) and it also means he doesn’t slip into mummy and daddy are stopping me getting what I want because they hate me so I’lll punish them.
incidentally, on the wee I highly recommend a vax carpet cleaner. Does a great job.