it happened to me once before, got in debug window, enter this command:
getpeerinfo
then search for the "banscore" option, if you see 1 in front of that, means you are facing same issue as mine,
i had tested everything, but only re-sync the wallet solved this. it seems wallet do finds some blocks which had been found before on network, so nodes keeps banning my ip and i lose connection, until i finally get no nodes!!
hope this helps you too, as software engineers always say:
reboot is the solution for everything
This is a convincing explanation. But I didn't understand which solution you are suggesting. By re-sync the wallet you mean just to close and re-open it? In this case I have already verified that this works.