I was able to fix this by adding some control flow for $woocommerce->cart->add_fee It turns out that the calculate_totals function is run again before the thank you page
if(isset($_POST['vat_number'])){
if($_POST['vat_number'] == '' OR empty($_POST['vat_number'])){
$woocommerce->cart->add_fee( __($vat_label, 'woocommerce'), $vat_total );
}
} else {
$woocommerce->cart->add_fee( __($vat_label, 'woocommerce'), $vat_total );
}
Very strange but i was able to resolve this issue by changing the rewrite slug from product-tag to product_tag. It looks like WP does not like the hyphen and prefers the underscore.
Thanks, that helped.
Turned out to be the SMTP settings of another plugin. The migrated settings were still pointing to the old server.