There are several reasons why you may not be able to connect to you shared document.
First there are two possible shared documents; ones created in Flow and ones created in Sketch. If you try to open a shared Sketch document in Flow or vise versa you will encounter this error.
Second in the connection to the internet. A sporadic or poor internet connection can cause the shared file to be loaded improperly or unexpectedly terminate. This will result in an error message as well.
Finally there is the issue of other software using a large portion of the bandwidth at the same time as Sketch or Flow is looking to use the network connection. Ensure that no software is doing a major update that requires a large amount of network bandwidth.