Answer
Check the Tax Rounding Level setting under Company > Tax Control > Invoice — when using an External Tax System, it needs to be set to Line Level, not Total Level. With Total Level, IFS recalculates the invoice's total tax using only the tax percentage carried over from the Customer Order Line Tax Lines, without factoring in the taxable-amount portion the external tax provider calculated — which is exactly what produces the wrong Gross/Tax amount when only part of an order's net amount was actually taxable. Setting Tax Rounding Level to Line Level resolves it.