We recommend that you use SharePoint Online OOB to implement your design.
Please following steps:
1.Go to the source Document library as an admin >> Library settings >> (General Settings) Save document library as template
2.On the Save as Template page, please select "Include Content" option
3.When you click list template gallery, you can see the library template you just created.
4.Select this template and click on Download a Copy under the FILES tab
5.Go to the destination Site Settings page >> (Web Designer Galleries) List templates
6.Click on Upload Document under the FILES tab, upload the template file just downloaded.
7.Then, go to Site contents page(classic mode). Click add an app, in the "Find an app" searchbox, entry template name.
8.Create a name for your new Document library. You will find that the source Document library is completely copied to the new Document library.
============================== Updated Answer ===============================
If you cannot see Save documnet library/list as template in SharePoint, please enable custom script feature.
Please run the below PowerShell command as an admin:
$TenantURL = "https://tenant-admin.sharePoint.com"
$username = "[email protected]"
$cred = Get-Credential -UserName $username -Message "Type the password:"
Connect-SPOService -URL $TenantURL -Credential $cred
Set-SPOSite -Identity $SiteURL -DenyAddAndCustomizePages $False
Here is a similar case for your reference: