FileDocument files not removed properly

I build microflow which removes all FileDocuments assigned to user when user is logged out, it runs by scheduler. Microflow successfully removes all database records about file documents, but some files are still stored in deployment/data/files folder. I tried to remove same files several times and result is different each time. Some time 3 of 7 files left, sometimes 2 or 4.
1 answers

Hi Eugen,
perhaps setting the deleteAfterDownload flag on files can help. See the mendix guideline -

As far as I know, mendix will delete files with this flag either after they are donwloaded OR when the user logs out.

I think its worth a try, if you are not using this already.