You've found a nice bug here
It's a bug in the FTP code (both library and console and visual example), specifically the if i > 0 then .. else part (given i = # of bytes received) and FTP handling of GetData.
The thing is, lNet reports 0 bytes received also when a recv fails due to "cannot handle more receives now, wait a bit" (TCP level). This isn't a typical scenario and in fact, it doesn't happen on Linux (at least not for the same FTP example) probably because Linux allocates bigger receive buffers. However FTP should handle this and a new logic should be introduced for these kind of receives that do not mean "end of downloaded file".
A workaround is simple:
In the "else" part where the downloading is "finished" add a condition like this (code from visual example):
FFile.Write(Buf, i);
end else if FDLDone + i >= FDLSize then begin // done whole file
// file download ended
This is not a fix however, just a workaround. I'll need to change the FTP library code (and examples too) for this logical path when recv itslef gives -1 (but lNet returns 0 because we just need to wait). There should be 2 "results" out of FTP.GetData. One should mean "data amount read (including 0)" and the other should mean "data download complete". This will require a change which could break old code tho, so it will probably go to 7.x. Until then I'll fix the examples to check for filesize (not exactly correct).