If deploying a certificate to a server throws a "key values mismatch" error, the certificate and private key are likely from two different pairs.
How the matching check works
In an RSA key pair, the public key embedded in the certificate and the private key file share the same modulus value. Extracting that modulus (or its hash) from both and comparing them tells you immediately whether they're a matching pair.
Common situations that cause a mismatch
This typically happens when a certificate renewal accidentally reuses an old private key instead of the one generated for the new CSR, when certificate and key files for several domains get mixed up during management, or when a CA reissues a certificate bound to a different key than the one from the original CSR.
The PKCS#1 vs PKCS#8 format difference
A private key file may start with -----BEGIN RSA PRIVATE KEY----- (PKCS#1, legacy) or -----BEGIN PRIVATE KEY----- (PKCS#8, generic). Regardless of format, the same modulus-comparison logic applies.