Are you receiving this error when you try to play in a friends Backyard Battleground, Multiplayer, Ops, Mystery Portal or Infinity Time? Or some combination thereof?
The error usually indicates a communication failure but the cause can vary just a little bit depending on what you were doing at the time. Anything involving being in a Co-Op setting could indicate a loss of communication with the Host Player, while anything Multiplayer would indicate the same happening with the central servers; it's not necessarily your connection on your end.
For anything where one Player is Hosting a Group or Co-Op session their Internet speed and connection stability affects everyone; I've joined many Graveyard or Garden Ops games where the person Hosting simply didn't have a robust enough connection to handle the demands which resulted in a lot of latency issues or a dropped connection.
Multiplayer involves the central servers so the same problems can pop up if the servers are experiencing high load, some sort of technical fault, or even if something between you and the servers happens to slow or disrupt your connection.