This isn't a realm ID issue or the player wouldn't even be able to connect at all.
Is your friend using a hacked version of the client? Did they modify any of their MPQ files? If this happens only when a loading screen appears, it seems to me that something is broken on the client side.
I remember when I was mucking around with trying to change the Draeni models into Night Elf models by editing the DBC files, I caused similar "malformed packet" issues when trying to /sit or /dance which not only disconnected me but crashed my client too.