What went wrong with XMPP and federated servers?
Actually this is exactly what Snikket is doing: https://snikket.org/about/goals
But in fact most servers are mobile friendly, and have been for many years. You can dig into the data at https://compliance.conversations.im/ (Conversations being the leading mobile XMPP client).
There is an active project working to improve things on the Apple side:
Also, XMPP is a good example of a 'victim' of embrace, extend, extinguish. I remember Facebook messenger, hyves chat, Google talk and briefly even WhatsApp, all in my desktop chat app. They all 'did' XMPP, but then removed federation, features or killed it entirely.