It is important to note that every transaction on the TRON network consumes resources.
TRON's resource model has two key components: Energy and Bandwidth. Bandwidth measures the size of transaction bytes stored on the blockchain; the larger the transaction, the more Bandwidth it consumes. Energy measures the computation required by the TRON Virtual Machine (TVM) to execute specific operations. Because smart-contract transactions require computation, each of them incurs a corresponding resource cost.
Bandwidth
All types of transactions consume Bandwidth. Transactions are transmitted and stored as byte arrays, and each byte consumes one unit of Bandwidth. Therefore, the Bandwidth consumed by a transaction is equal to its transaction size in bytes.
If the available Bandwidth is insufficient, TRX is burned to pay the Bandwidth fee. Currently, each unit of Bandwidth costs 0.001 TRX.
Energy
Smart contracts consume a certain amount of Energy for each instruction they execute. The amount required varies with contract complexity; Energy is calculated and deducted instruction by instruction during contract execution.
If the available Energy is insufficient, TRX is burned to pay the corresponding Energy fee. Currently, each unit of Energy costs 0.0001 TRX.
Note: The unit prices of Bandwidth and Energy are determined by on-chain parameters and may change through network governance. Please refer to the current network parameters. View the current parameters on the TRONSCAN Network Parameters page.
Returning to the original question: under TRON's resource model, the resources needed to execute a transaction are consumed during the execution process, even if the transaction ultimately fails. If the available resources are insufficient, TRX is burned to pay the resource fee. This is why a failed transaction may still incur a fee.