OK, there’s a bunch of things to deal with here, and it’s not clear which one is the cause of your specific problem.
First up, altool has been deprecated for the purposes of notarisation. Switch to notarytool; it’s better, stronger, and faster. For the details, see WWDC 2021 Session 10261 Faster and simpler notarization for Mac apps.
Second, don’t use --deep when signing. See --deep Considered Harmful. And for detailed instructions on how to sign a product manually, see Signing a Mac Product For Distribution.
Third, this is a concern:
ditto -c -k --sequesterRsrc --keepParent "$dmgPath" "$zipFileName"
It’s best to avoid relying on extended attributes in a Mac app (because there are various distribution channels that strip them). And if you do have extended attributes, --sequesterRsrc is unlikely to be your friend; that only makes sense if your transferring the zip archive to someone who wants to discard the extended attributes. For more on this, see Extended Attributes and Zip Archive.
Having said that, it looks liike you’re doing this when creating your disk image. That’s unnecessary on two fronts:
Forth, the hardened runtime (--options runtime) and entitlements (--entitlements "$entPath") make no sense on a disk image. Don’t set them.
Finally, this is nonsense:
codesign … --verify … --sign "$cert" "$appPath"
It’s telling codesign to both sign and verify. I’ve no idea what that’ll do [2]. Honestly, I’m surprised it doesn’t error out, because the codesign man page says:
codesign requires exactly one operation option to determine what
action is to be performed
If none of the above helps, grab the disk image you submitted for notarisation, mount it, run the following command against the app on the image, and then post the results:
% codesign --verify --deep --strict /Volumes/MyDiskName/MyApp.app
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] I’m talking .dmg files specifically. Very old traditional Mac OS disk images did use resources.
[2] Some testing (on macOS 12.2.1) suggest that the last operation is the one that holds sway but, yeah, don’t rely on that.