Dynare has to run twice to execute at the second try

This happens when the sub-folder that Dynare needs to delete for a run is locked by some process. Usually closing Matlab once helps. If that does not work, it may be an active cloud drive like Dropbox or an antivirus-program locking the files.