Does BTC return fee in a failed transaction? From wiki 'The fee may be collected by the miner who includes the transaction in a block.' wiki

So I think it will return your fee , in a failed transaction.But I can't find any other article about it. Does it really return fee?
Yes, effectively.  It isn't really that it's "returned", but that the fee is never actually "collected" until the transaction is confirmed.

If your transaction isn't confirmed, then no money moves at all.  The entire amount, including the fee, remains available for your use in a future transaction, though you may have to wait a little while for it to expire from the memory pool of other nodes on the network, and depending on your wallet software, you may have to use some obscure commands to make it forget the original transaction.