Something does, or did, have the file open. UiPath has an issue where sometimes it doesn’t “let go” of files it has accessed.
Before your delete, put these:

The second one is WaitForPendingFinalizers
Something does, or did, have the file open. UiPath has an issue where sometimes it doesn’t “let go” of files it has accessed.
Before your delete, put these:

The second one is WaitForPendingFinalizers