Solved it myself! It seems like the #serveradmin script for modifying / adding the domain aliases to the ejabberd server does not work correctly. After looking through the different sm_.xml files created when adding a domain the script does not modify the <local><id> that the server uses to identify the JID with.
After manually modifying that id to match my domain, and restarting the ejabberd server, it works fine again!
It seems like when adding or modifying the jabber:hostsCommaDelimitedString="" the server default hostname is always inserted into the <local><id>.
I found them, run the command "sudo serveradmin settings jabber" in Terminal and you will see the path. It is Library>Server>Messages>Jabberd
This fixed it for me too. We actually use the FQDN, but still the service in the sm.xml file states that it should resolve it correctly. Why does the DNS not resolve the FQDN correctly?