I am also using an SSIS package which OCCASIONALLY inserts a '?' into the first winscp> command causing 'Unknown command'. This causes the package to technically fail (although the file is still downloaded from a remote server successfully). The scheduled SQL job (run each evening) marks it as a fail which is a pain as we have to check it just in case the failure is for a different reason. If there is any pattern in when the ? is inserted it always seems to be on a Sunday when some weekly database admin tasks Including on the SSISDB) take place earlier in the day. But this could be a complete red herring.
In the last 2.5 years since the problem was first reported, Did you ever get to the bottom of why this '?' character is SOMETIMES introduced and how to rectify it? I'm on WinSCP 5.9.2 Build 6958. Thanks.
It does not look like WinSCP question. You should probably ask on SSIS-related forum.