This is very strange. I don't know what to make of it. Is it possible at all to run this command from the console of the server? Can it be that your ssh connection is timing out? Any chance you can copy the FreeSurfer output somewhere local and run the script anew?