As WooCommerce uses WordPress' wp_safe_redirect() it does not permits redirects to any external hosts. So you need to add the preferred host to the whitelist. And for modifying the whitelist use allowed_redirect_hosts
it is described below
/**
* Adds example.com to the list of allowed hosts when redirecting using wp_safe_redirect()
*
* @param array $hosts An array of allowed hosts.
* @param bool|string $host The parsed host; empty if not isset.
*/
add_filter( 'allowed_redirect_hosts', 'wpse_allowed_redirect_hosts', 10, 2 );
function wpse_allowed_redirect_hosts( $hosts, $host ) {
$hosts[] = 'example.com';
return $hosts;
}
I would recommend you to use the code above with your original code (customizing the host as needed) for allowing WooCommerce users to be redirected to an external domain after completing the registration process.