When I searched on the internet, I found one thread on the Nintendo Support Forums where other unlucky New Leafers were marooned to their own towns, and experiencing the same fate as we were. Some of the people experiencing the error had physical game cartridges, but it seemed like the majority of people had downloaded versions, just like us. We tried various times throughout the day to connect to the other towns, but didn't have any luck. Well, I searched again on the internet and found that Nintendo had updated their Support page for the error code 018-0512 and included a possible fix for the error.
It appears that you have to assign a dedicated IP address for your 3DS, and then also open the DMZ settings on your router to allow for communication between your 3DS and other 3DS systems you want to connect to. Well, I was able to assign my 3DS a fixed IP address and also log into my router settings and follow the suggested fix by Nintendo to try and resolve the issue. Once I followed the instructions, I was able to get into one town, but still unable to get into others. The fix did say that if you still experience difficulty, you may need to have the person on the other end follow the same instructions you just followed to ensure communications are not blocked, so maybe that's the issue.
Funnily enough, I had issues long time ago with my Animal Crossing Wild World towns and could never communicate via WiFi because an error always occurred when I tried to go out of the gate; we always just used local connections to communicate between towns. With this proposed Animal Crossing New Leaf error fix that was suggested, that issue is now resolved, so I guess I will finally get Blanca to visit my Wild World towns (yes, we still play Wild World too!) -- either way, I'm getting out of a town one way or another!
If you want to view the proposed fix for the Animal Crossing New Leaf 018-0512 error (it may also fix the 018-0511 error), visit the Nintendo Wi-Fi Connection Customer Service page. I still have intermittent issues with visiting some towns after the fix, but hopefully it'll all get worked out eventually. Good luck!