There is the irrelevant error message output by the signrawtransactionwithkey command.
Expected behavior
Hex string of the raw transaction with signature OR meaningful message about an alternative way to achieve one.
Actual behavior
0{
1 "hex": "0200000001a2c0d82460883696219dbca6f545f72963b2b3ee085d832eb5ef9a69a374af160000000000fdffffff01e011000000000000225120052e44f45a6e381be8e06d3f3362b58034a68ba98081e24de7bfc5795420a90b00000000",
2 "complete": false,
3 "errors": [
4 {
5 "txid": "16af74a3699aefb52e835d08eeb3b26329f745f5a6bc9d219636886024d8c0a2",
6 "vout": 0,
7 "witness": [
8 ],
9 "scriptSig": "",
10 "sequence": 4294967293,
11 "error": "Witness program was passed an empty witness"
12 }
13 ]
14}
To reproduce
0
1$ signrawtransactionwithkey "02000000011157667b81a1a4e688938c42ee7cdea23761cb7622a3476f0bc8ace7d0ec523100000000000000000001e8030000000000002251203b82b2b2a9185315da6f80da5f06d0440d8a5e1457fa93387c2d919c86ec878600000000" '["cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE"]' '[{"txid": "3152ecd0e7acc80b6f47a32276cb6137a2de7cee428c9388e6a4a1817b665711", "vout": 0, "scriptPubKey": "5120c38859777bc9c3294d3587035fc3823a146dabaab1fa250bc04e92f16887a065", "amount": 0.00004242}]' "DEFAULT"
System information
Console in Bitcoin Core 24.0.1 portable, Windows 11. (Occurs in both cases of a descriptor wallet loaded and not loaded). Hint: signrawtransactionwithwallet works fine if preceded with the importdescriptors ‘[{“desc”: “tr(cUTFbLPUaBAPmTKwjcDs4rWHUSEUbUBfkPMogrbTmQFnJA3vgrLE)#tdkpah70”, “timestamp”: “now”}]’