On the screen where you were presented the option to select to pay with credit card or deduct from federal refund, the $39.99 fee is listed right below that option to pay with refund. And it's also stated in the agreement that is presented to you to read and sign before filing the return.
If you had already filed, then yes, it would not allow you to remove that Refund Processing fee that is charged by the bank that handles refunds when you choose that option.
But if you had not filed at that point when you saw the fee, you could have used steps here How do I remove refund processing fees in TurboTax Online and change my payment method? to remove that option and pay with credit card.