OK, I have finally sorted this out, superficially at least.
While I cannot reproduce the problem myself, a cooperative end user has been running tests and returning log file to me.
Whats happening I believe is that when you call DeleteFileUTF8() in windows, the file is (almost always?) deleted but sometimes the function returns false. My guess is that its not having its return value set reliably. There is a path through the function that allows Result to be random. As the function very rarely fails, few of us check its return value and it has gone unnoticed.
My diagnose is based on calling DeleteFileUTF8() and if it returns false, call FileExists() to really see if its gone. If FileExits() retuns false, allow the programe to proceed, hopefully normally. So far, his tests indicatate that is the case.
I will, in the near future, try and step though the Windows code (bit out of my comfort zone) and will follow up on what I find.
For the record, this end user also has Vera-Crypt running on his windows box and also uses PortableApps.com. I don't think there is any connection but worth noting.....
Davo