I still have this problem where my mom's iMac will occasionally send a SMS (sent via macOS Messages and delivered via her iphone) to the email address in my contact, rather than my phone number. Somehow it thinks that xxxx@yyy.com is a phone number, but +1xxxxxxxxxx isn't. Tmobile then takes the SMS and forwards it to xxxx@yyy.com, as happened to you. So frustrating at how hard this is for Apple to get right. I don't even have iMessage, but I guess that's the point -- interoperability, where it exists with Apple products, will be usable enough to get started but just buggy enough to be infuriating.