When having problems with not updating shipping methods and total price when changing country and shipping methods add this code to the functions.php

/*****************************
 * Refresh checkout fields on changed country and shipping method
 ***************************************/

add_action('wp_footer', 'billing_country_update_checkout', 50);
function billing_country_update_checkout() {
    if ( ! is_checkout() ) return;
    ?>
    <script type="text/javascript">
    jQuery(function($){
        jQuery( document.body ).on( 'updated_checkout', function(){
            
            $('select#billing_country, select#shipping_country, .shipping_method').on( 'change', function (){
            var t = { updateTimer: !1,  dirtyInput: !1,
                reset_update_checkout_timer: function() {
                    clearTimeout(t.updateTimer)
                },
                trigger_update_checkout: function() {
                    t.reset_update_checkout_timer(), t.dirtyInput = !1,
                    $(document.body).trigger("update_checkout")
                }
            };
            $(document.body).trigger('update_checkout');
        });

});     
    });
    </script>
    <?php
}