Hi @DNKMK ,
I don't have lisense for Azure Automation, I only have permissions to SharePoint. So I tested this problem from the level of sharepoint and powershell.
I tested the Copy-PnPFile function with Powershell 7 and PNP-Powershell Module 1.12 in SharePoint Online. Everything works perfectly. The problem you mentioned did not occur. So I think this problem should have nothing to do with SharePoint and PnP Powershell.
Here is the code I tested:
Connect-PnPOnline -Url https://mydomain.sharepoint.com/sites/xyzax-version1/
# Copy the file to another doclib in the same site
Copy-PnPFile -SourceUrl "/sites/xyzax-version1/dlibrary1/Document11.docx" -TargetUrl "/sites/xyzax-version1/dlibrary2/Document11.docx"
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.