Transaction failed but the fee was still be deducted.
The cost is referred to as a 'fee' with respect to Ethereum. It equals "gas * gas_price." The fees are used to pay the miner to package your transaction. Every transaction has a fee irrespective of the status of the transaction. The two are not connected.
The fee is deducted by miners, bitPub will not charge for transaction fee at this moment.