You are absolutely correct. Problem solved!
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
startto run WinSCP? It's no used in any example on this site. Remove it.
startlaunches WinSCP asynchronously not waiting for its exit. So when testing exit code, you are actually testing exit code of the previous command, the
echo, that is always 0.