Your script was relying on a deprecated functionality that was removed in 5.14:
https://winscp.net/tracker/1647
See also
https://winscp.net/eng/docs/incompatible_changes#older_automation
https://winscp.net/tracker/1647
See also
https://winscp.net/eng/docs/incompatible_changes#older_automation