How to create raw transactions with custom fees?
so I should only use the same UTXO generated by each user when depositing btcs Or is it possible to use other UTXOs as long as the quantity is the same?
  


This is up to you, although it would probably be safer to only spend the users deposit UTXOs to make sure nothing has gone wrong (e.g. private key leak and the coins have ready been spent). But as long as the user gets the right amount of bitcoin at the end, it doesn't really matter.


  
  I have read in bitcointalk that the inputs of a raw transaction must be less than or equal to the outputs of that transaction. Is it not possible to use inputs higher than the outs and "return" the surplus funds again to a wallet of my node?
  


I believe you have misread the information you found, or it was wrong. The inputs of a transaction must be greater than or equal to the outputs, otherwise you would be somehow generating new coins. If the inputs are strictly greater, the difference is given to the miners of the transaction as a fee. To "return" the surplus funds, you need to simply make a transaction output which sends the coins back to you, known as change.

If you generate a new transaction manually using bitcoin RPC calls, it will automatically estimate the fee itself. To use a custom fee rate, you can set the feeRate in the FundRawTransaction call. You can also set the transaction rate for all future transactions while the wallet runs using SetTxFee.