Try overriding what Temp directory Calibre is using via the Environment variable CALIBRE_TEMP_DIR.
Https://manual.calibre-ebook.com/customize.html#id1
The purpose of the above would be to ensure that any aggressive file cleaner that you run automatically is not deleting newly created Calibre temporary files.
Calibre Version 3.17 had the change
"Store temporary files used by the editor and viewer in the cache directory to try to prevent errors caused by 'file cleaner' programs deleting temporary files still in use", but you have not mentioned either the editor or the viewer.
You also have not indicated whether or not you are running as an Administrator or User.
DaltonST