XMPP is massively bloated protocol that is badly managed for last 2 decades
IRC (real IRC) solves this by not solving it, and accepting that message order can differ between servers. If two operators kick each other on two different servers at the same time, usually both get kicked - the command is validated on the origin server and the rest of the network takes it as gospel, even if it doesn't make much sense in their own local state.