WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]

Posting the solution that worked for me in case it helps anyone in the future (Credit to Rup & WooCommerce Community Slack)

I was filtering the tax class getter on the cart side and that was doing what I needed, so I was focused on figuring out how to also filter the tax class getter on the order side. Devinsays on Community Slack recommended the obvious-in-hindsight solution of filtering also the setter on the cart side and then the order side just works without any filter. In other words, when I re-assign the tax class for the calculation on the cart side, actively set it on order creation. Then it will be attached to the order item for the recalculate later. Something like this:

function also_reassign_the_setter($item, $cart_item_key, $values, $order){
    //some custom logic
    $item->set_tax_class('class_one');
}
add_action('woocommerce_checkout_create_order_line_item', 'also_reassign_the_setter', 20, 4);