Use PSBT instead of raw transaction:
First import the necessary descriptor to the wallet (
command already provided).
Secondly, create a transaction:
createpsbt "[{\"txid\":\"<TXID>\",\"vout\":<N>}]" "[{\"<address1>\":<amount1>},{\"<address2>\":<amount2>}]"
Thirdly, process the psbt (u
pdate, sign):
walletprocesspsbt "<PSBT from above command>"
Fourthly, finalize it:
finalizepsbt "<processed PSBT from above command>"
Lastly, send it to mempool:
sendrawtransaction "<signed raw transaction from above command>"