// Now we create and send the email verification link to the user for the new email.
await EmailVerification.sendEmailVerificationEmail(session.getTenantId(), session.getUserId(), email);
should be
// Now we create and send the email verification link to the user for the new email.
await EmailVerification.sendEmailVerificationEmail(session.getTenantId(), session.getUserId(), session.getRecipeUserId(), data.newEmail);
to match the signature of sendEmailVerificationEmail
https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/change-email-post-login#step-2-validate-the-email-and-initiate-the-email-verification-flow
probably has an error, I think this line:
should be
to match the signature of sendEmailVerificationEmail