Hi,
There are two issues at play here.
The first is that you not getting a very accurate error message because of the way the application has been coded.
The message you are getting "WHENEVER ERROR CALL: The error-handler recursively calls itself." is telling you that an error has occurred, and then when the code has passed through the error handling routine, another error has occurred, at which point the runner stops before ending up in an infinite loop. If you want to see the original error, you can most likely can read it in the ERRORLOG. Your code does need to be tided up to handle this gracefully. The normal technique is to ensure that the FUNCTION that is called with your WHENEVER ANY ERROR routine has a different error handler. Normally this involves stopping quickly with no UI (or minimum UI), rather than the nice tidyup / error dialog that your error handler might have.
The possible misunderstanding that whoever coded it had is that WHENEVER is a compile time directive and has no concept of scope. Placing WHENEVER [ANY] ERROR in your code applies to ALL lines below until it hits another WHENEVER [ANY] ERROR line. The compile time directive does not stop at END FUNCTION. This is the "Important" note here
http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_Exceptions_006.html.
As to the actual error, you say it works with GDC over HTTP, and you get the error when trying GDC over SSH with VPN. The important thing to note with this is that it is likely that the fglrun process that is launched has a different environment and/or process owner and/or current directory. So to debug further you could investigate those.
My money is that environment variable FGLSERVER is not set correctly, and so you are initially getting a cannot connect to GUI error message, the code triggers the WHENEVER ERROR handler, and inside that error handler there is some user interface, so the error handler is triggered again, and hence you get the "error-handler recursively calls itself" message.
The GDC version although old and you should have upgraded years ago, is not likely to be an issue here.
Reuben