A customer ran into this, so I added their changes. They added a call to pmpro_getSpecificMembershipLevelForUser() after getting the user since the next line if ( ! empty( $user->membership_level->confirmation ) ) { will always be false, because $user->membership_level is not set. $invoice->membership_level does not contain the custom confirmation message, so the custom confirmation message will never be shown. I also changed $invoice to $user.
devs to check out https://github.com/strangerstudios/pmpro-pay-by-check/pull/85#issuecomment-1599135228.
This could be merged and https://github.com/strangerstudios/pmpro-pay-by-check/pull/85 closed as it preserves jarryds commit.