Are you doing this option when you export each file? I think that might be why you’re getting duplicates. Because each downloaded file has its own version of the connected libraries.
When exporting files using the export shared libraries option, you shouldn’t need to download the library files at all, as these will be included with your files.
I believe if you download Pr_4 and export shared libraries, then Pr_1, Pr_2 and Pr_4 should work as expected. But Pr_3 is tricky, because exporting that with shared libraries would end up with a duplicate of Pr_1.
A workaround for this is to:
Publish Pr_3 as a(n empty) library.
Connect the Pr_3 library to the Pr_4 file.
Export Pr_4 with shared libraries
Import your downloaded file to get all files with libraries connected and references working.
If you want, you can then disconnect the Pr_3 library from the Pr_4 file and unpublish Pr_3 as a library.
If your use case is for sharing the project with other people, using a team would definitely be an easier solution. But if you’re trying to duplicate files with libraries to other projects, this is probably a reasonable workaround.
I should say for anyone reading this who finds all the numbers confusing, the short version is this:
If you want to export a collection of files that include multiple files referencing the same libraries, choose the file that references the most libraries as your download point. For any other files that are not referenced by the download point file, publish them as empty libraries, and connect them as libraries to the download point file. Then Download Penpot file from the download point file, using the export shared libraries option. Once you’ve imported your file to another instance, you can safely disconnect and unpublish the empty library files.
Maybe an Export project option could be valuable to other folks with this use case?