You need to debug the main issue first
wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
functions.php
// define the wp_mail_failed callback
function action_wp_mail_failed($wp_error)
{
return error_log(print_r($wp_error, true));
}
// add the action
add_action('wp_mail_failed', 'action_wp_mail_failed', 10, 1);
For more detail read this article LINK