I have this issue too. It's super frustrating, especially when it comes to villager trades. I was trading with a user on here and we trade forever to connect so I could pick up Cookie. Long story short: She got her villager easy when I opened my gates. Cookie was voided because after we ended the first session, we couldn't get the next session to work, erroring every single time. That user was the only person at first I couldn't connect with until I met some users on FB and had the same issue happen. We had to third party trade through a mutual friend and it was just a bit inconvenience for everyone. Lately, my connection's been a bit hit-or-miss all together because of the weather; I have to rush trade during breaks in the rain. I have a ton of items by my gate that I need to deliver too. :/
I really hope you can figure it out.

I never understand why it happens. It's just frustrating for everyone and it makes me sad that you kind of have to pass on villager trades. There has to be an easy fix to all this.