When uploading something, close() for a socket is called too early when there is still data being transfered. There is an odd 2 second timer in disconnectFromHost() (qabstractsocket.cpp, line 2756) that is started right after last bytes have been written to socket. Once this timer runs out, it will close the socket and current transfer is aborted. This results in an incomplete file on the FTP server.
It can be seen that after disconnectFromHost is called, data is still being transferred and it suddenly ends. If I remove the timer, upload eventually finishes successfully and it is successfully disconnected (did not try if this is still an issue on macOS tough). However, there are probably better methods
To reproduce, modify proxy settings and ftp server address in the attached example. At least CCProxy can be used as a proxy to reproduce this. And pyftpdlib works as a simple server: python -m pyftpdlib -w.