FarCall doesn’t make the target database active. The database you are calling from may have a fileglobal variable with that name, that hasn’t been given a value, or there might be a global variable with that name, but no value. When you run it locally, it gets the value from the variable belonging to that file. If there is also a global by that name, the permanent variable (which is a file global) takes precedence. When you do the FarCall, and another database is active, its fileglobal is in scope, or if it doesn’t have one, the global variable is in scope.
If this is the only thing the procedure is doing, you might just want to do something like this, instead of the FarCall.
theGlobal = fileglobalvalue("TargetDatabase", "thePermanent")