Just to make sure I understand it correctly:
WinSCP fails to delete a particular local empty folder. Even after repeatedly running the same synchronization – still fails on the same folder.
This is correct.
You then delete the folder manually (in Windows Explorer), recreate the same folder – and then WinSCP is able to delete it. Is my understanding correct?
I haven't actually tried this experiment. What I did was create an entirely different path, per your suggestion, and confirm that with the folder removed from the server, WinSCP would delete on the desktop with sync. I
have confirmed that if WinSCP fails to delete an empty folder on the desktop, I can remove it with Windows Explorer, subsequent to the script running, or manually running the GUI and leaving it open after the failure.
Also when the script is not able to delete the folder, is WinSCP GUI able to delete it? Both manually when selecting it in file panel and automatically by running the synchronization in GUI.
I will try this. Should it fail, I will delete and recreate with Windows Explorer, and repeat the experiment in the WinSCP GUI.
I'll report back with my findings.