The different versions will have separate towns and separate save files, but other than that it should all work the same and should not affect on-line play. I haven't tried doing both personally so I don't have hands on experience with this but that's how it should work. I cant seem to find any source to verify this though, are you sure its not some other connection issue?
Interesting, to verify the friend code is constant you could always load up digital and while in game press the home button and view your own friend page to see if it says you are on-line in new leaf. I'm fairly certain they are the same but never hurts to check.