I think the request in this ticket, is not so much to get to the bottom of what error might occur when the connection changes modes (as the error we see in Couch may be different depending on exactly when the connection changes). Really what we want is a way to ensure that replication retries automatically anytime it sees that it's stopped making progress.
The preferred way to set up persistant replications (which have more robust retry capabilities) is via the replicator db. The replicator db is documented here:
Essentially you just save documents to the replicator db, that have the same JSON as a replicator POST command. You can then query those documents to see what state the replication is in. There is a config entry which governs the amount of retries that are done: replication_retry_count
As an alternative, assuming that in your current code, the POST to _replicate returns a failure at this point, you can just re-POST when you see that failure.