It's going to require customization, because the Fixed or By Weight Total shipping provider (plugin) does its own subtotal calculation with individual items, to eliminate items/products that are marked 'free shipping'.
Or, you can use Shipping Director which has several
built-in variables such as
$SubTotalWithoutDiscounts
$SubTotalWithDiscounts
$SubTotalWithoutDiscountsInclTax
$SubTotalWithDiscountsInclTax
You could have Shipping Director call your existing Fixed or By Weight configuration, and then use a
Surcharge Expression to negate the rate (similar to
this example). For example:
Option
Shipping
true
Shipping.FixedByWeightByTotal
Country = "GB" and [$SubTotalWithDiscountsInclTax] > 39.99 ? -[$Rate] : 0 (If you use the above, then remove any Fixed or By Weight configuration rules that, as you put it, "set additional fixed cost when an order is above 39.99 to 0").