I like going for the root cause! :)
Here is the PasteBin of the Packaging.log file: https://pastebin.com/r28y6pcc
2025-06-25 10:40:24 +0000 Running /usr/bin/ditto '-V' '/Users/martin/Library/Developer/Xcode/Archives/2025-06-25/In the Line of Fire 25.06.25, 12.39.xcarchive/Products/Applications/In the Line of Fire.app' '/var/folders/rq/k4wtl7js79s3ydcvfnpc42f80000gp/T/XcodeDistPipeline.~~~lJxpXe/Root/Applications/In the Line of Fire.app
In that source app (first argument to the ditto command, there is (yet) no embedded.provisionprofile, that is only the in the generated .pkg file as it seems. Hmm, why do you have then the embedded.provisionprofile in your build?
But (!) I can see the _CodeSignature folder and inside there it is already root-only!
But what is weird then, why does Xcode use root-only then too for the embedded.provisionprofile. If it copies that from the source downloaded profile and I changed those to 755, it should work. It would be nice if Xcode could make these sanity checks itself and auto-correct the rights as it knows what rights are expected. That is at least my current understanding of it.
Maybe Xcode applies automatically the same rights to the embedded.provisionprofile as the CodeSignature has. If so, it would need a preprocessing step to fix the rights in there, but at what stage in Xcode?
drwxr-xr-x 3 martin staff 96 25 Jun 12:39 _CodeSignature
drwxr-xr-x 6 martin staff 192 25 Jun 12:39 Frameworks
-rw-r--r-- 1 martin staff 1938 25 Jun 12:39 Info.plist
drwxr-xr-x 3 martin staff 96 25 Jun 12:39 MacOS
drwxr-xr-x 3 martin staff 96 25 Jun 12:39 MonoBleedingEdge
-rw-r--r-- 1 martin staff 8 25 Jun 12:39 PkgInfo
drwxr-xr-x 4 martin staff 128 25 Jun 12:39 PlugIns
drwxr-xr-x 7 martin staff 224 25 Jun 12:39 Resources
martin@MartinS90NL943C Contents % cd _CodeSignature
martin@MartinS90NL943C _CodeSignature % ls -l
total 112
-rw-r----- 1 martin staff 54870 25 Jun 12:39 CodeResources