Parsing RSA2048 certificate fails with error code MBEDTLS_ERR_PK_INVALID_PUBKEY

Solved. My MPI size was incorrect for the RSA key size.
Has to use a MPI size 256.
I had adjusted the MPI to reduce memory

#define MBEDTLS_MPI_MAX_SIZE 256