It doesn't matter where you are a resident. If it is bought in another state, only that state's laws apply. Mass compliance only applies within the Mass borders.
You don't get it. There is a piece of US code (federal law) that attempts to force other-state compliance by dealers. Some remote FFLs obey it, others don't. It's rarely enforced, but it is a felony for the dealer, though, if they're caught disobeying it. I think if a serious court challenge was mounted against it that it would probably fail (because that particular law violates a bunch of commonly accepted legal principles) but nobody is going to bother for what is mostly a corner case.
Here's a simpler example. Go to NH as an MA resident and try buying a rifle or shotgun in NH from an FFL without an MA LTC or an FID at least. You can't do it. You will say "Well isn't the FID and LTC only required in MA? " Strictly speaking it is, but that piece of US code applies and the dealers will ask for an MA license.
Jdubois and I had a huge thread about this a few years ago. I wish I could find it and it would lay it all out.
ETA: When it comes to non-FFL stuff, you are definitely right. For example I can build an "Evil" AK or an "Evil" AR and leave
it in NH, with whatever evil features I want, and that is 100% legal. I just can't buy the gun configured that way from an FFL dealer. (or well, at least, he's not supposed to sell it that way to me!)
-Mike