From the man pages:
2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate
the issuer certificate of a looked up certificate could not be found. This normally means the list of trusted certificates is not complete.
20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate
the issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found.
I'm not sure if I get that. For me it sounds both quite the same. What do they mean with "looked up certificate" and "untrusted certificate". An untrusted certificate would be any certificate along the chain but the root certificate. A look up certificate could be an externally retreived certificate, like though
AuthoritiyInfoAccess. But I'm really not certain here.