Okay, sorry. In the first two cases (encryption), GnuPG 2.2.33 generates
[GNUPG:] INV_RECP 10 F3C987C36C5C6343C9A5D5A1A3F494F6028E4866 [GNUPG:] FAILURE encrypt 53 gpg: [stdin]: encryption failed: Unusable public key
and exits with error code 2, whereas 2.2.32 doesn't display these messages and exits with return code 0.