I was constantly seeing this error:

Permission denied.
Error code: 3
Error message from server: Permission denied

In my case there was a difference with the timestamp. In settings I setted ENDURANCE like this and it worked like a charm:

UPDATE: Also check the privileges of the parent folder. When WinSCP transfer files this way, it creates a temporary file at the server. If WinSCPs user doesnt have enough privileges to create that temporaty file, then it will show the same error.

If that doesnt work, try the following:

https://ntalam.com/2022/01/15/winscp-writing-permissions-using-debian-10/
https://ntalam.com/2023/03/15/winscp-error-2/