It works in communities, not corporations. Every federation seems to die when enough millions are connected to it. Facebook used xmpp for chat. Google chat could federate too. Apple promised iMessage and then hid behind a silly excuse.
It's extremely against company interests to federate.
That has nothing to do with federation. A Gmail user can talk to an Outlook user. A Slack user cannot talk to a Teams user.
Email is only federated because it was used before it was commercialized. If companies could monopolize email they would. The solution here is government regulation requiring interconnection, like we got with phones and text messaging.