Here is another scenario. There was not enough space on the remote machine. After making some space, remote ssh via vscode worked