The issue is resolved.
The homefolder was set to /directory . However, the module expects something like /directory/. The last slash was missing, and that caused that the module didn't know what folder it was in.
Niels, Are you using the new (S)FTP Module, or the SFTP Connection Module built by Capgemini?. The latter supports only Mendix4 'out of the box'.
If you are using the Cap module, you could try replacing it with the new one.
If you are using the new one, could you send me some specifications so we can reproduce the issue?