what type of script are you using to transform the SO to an invoice? i have run into this before where it was a UE transforming it, and in my case US taxes were calculated by Avalara, which also runs on a UE script - and UEs can't trigger other UEs. so we had to switch to transforming the SO to an invoice in a scheduled script instead of a UE to allow the avalara scripts to run and calculate tax.