Notarization works well from the Xcode UI, but the moment you want to handle this from the command line it's mostly trial and error. At least I have a shell script now that handles all commands for me. And this support page by Apple:

Sign in to participate in the conversation

Generalistic and moderated instance.