I have a flow that is trigger when a file is created in SharePoint. However, sometimes when the file is created the filename sometimes appears with a "~tmpXX_" (where XX is random numbers/characters) at the start of the filename. I can check for the existence of this string and remove it for any specific processing. However, at the end of the flow we want to delete the file, which means using the File Identifier. The File Identifier has the "~tmpXX_" still referenced at the end of the flow. By the time the flow has run, the "~tmpXX_" does not appear in the filename anymore. Nor is it ever visible within SharePoint. It's like the "When a file is created" action is triggered, it's still uploading the file.
How can I prevent this flow from triggering too early or remove the "~tmpXX_" from the file identifier so the flow doesn't fail deleting the file?

Outputs from when a file is created:

Delete File action:

Failure message:

The filename in the library does not contain "~tmp9D_".