user91116: I want to generate P2SH-P2WSH with script P2PKH.
My public key is    027712968e8f2f9dfa79abe10940a3d915a0c95a0b97750881e6201acf2b66da97

SHA256 and RIPEMD160 of Public key
 ---------- Witness Script --------- 
#OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG
76a914651554088a30217e6d0261cce1634e9d90b03f7088AC

 ---------- scripthash --------- 
#SHA 256 of Witness script    
1eb6c6c3ad4e395e66e3521c23486863fe363939db88c38a3c6461cb66f80254

  ---------- Redeeem script ---------     
#add OP_0 (0x0020{32-byte scripthash})
00201eb6c6c3ad4e395e66e3521c23486863fe363939db88c38a3c6461cb66f80254

  ---------- SCRIPTPUBKEY --------- 
#RIPEMD160(redeem script)
#OP_HASH160 hash160(redeemScript) OP_EQUAL
A9149fbb6d60a6d26f67b9673334c3863cdec224169787

ADDRESS:
#C4A9149fbb6d60a6d26f67b9673334c3863cdec224169787 base58 cecksum
2N7ooxTaU8FRgfTrhYn3FjwUcFqeNRvRU5k

Now I want to try to spend form this address.
bitcoin-cli signrawtransactionwithkey $TX_DATA '["'$PK'"]' '[{"txid":"'$TXID'","vout":'$VOUT',"redeemScript":"'$REDEEMSCRIPT'","scriptPubKey":"'$SCRIPTPUBKEY'","witnessScript":"'$WITNESSCRIPT'","amount":"'$TOTAL_UTXO_AMOUNT'"}]'

I receive this error

redeemScript does not correspond to witnessScript


user48884: At the time this question was asked, this issue was the result of a bug in Bitcoin Core. It was fixed in PR #18484 and is available in Bitcoin Core 0.20+.

91116: <p>I want to generate P2SH-P2WSH with script P2PKH.</p>

<pre><code>My public key is    027712968e8f2f9dfa79abe10940a3d915a0c95a0b97750881e6201acf2b66da97
</code></pre>

<p>SHA256 and RIPEMD160 of Public key</p>

<pre><code> ---------- Witness Script --------- 
#OP_DUP OP_HASH160 &lt;PubKHash&gt; OP_EQUALVERIFY OP_CHECKSIG
76a914651554088a30217e6d0261cce1634e9d90b03f7088AC

 ---------- scripthash --------- 
#SHA 256 of Witness script    
1eb6c6c3ad4e395e66e3521c23486863fe363939db88c38a3c6461cb66f80254

  ---------- Redeeem script ---------     
#add OP_0 (0x0020{32-byte scripthash})
00201eb6c6c3ad4e395e66e3521c23486863fe363939db88c38a3c6461cb66f80254

  ---------- SCRIPTPUBKEY --------- 
#RIPEMD160(redeem script)
#OP_HASH160 hash160(redeemScript) OP_EQUAL
A9149fbb6d60a6d26f67b9673334c3863cdec224169787

ADDRESS:
#C4A9149fbb6d60a6d26f67b9673334c3863cdec224169787 base58 cecksum
2N7ooxTaU8FRgfTrhYn3FjwUcFqeNRvRU5k
</code></pre>

<p>Now I want to try to spend form this address.</p>

<pre><code>bitcoin-cli signrawtransactionwithkey $TX_DATA '["'$PK'"]' '[{"txid":"'$TXID'","vout":'$VOUT',"redeemScript":"'$REDEEMSCRIPT'","scriptPubKey":"'$SCRIPTPUBKEY'","witnessScript":"'$WITNESSCRIPT'","amount":"'$TOTAL_UTXO_AMOUNT'"}]'
</code></pre>

<p>I receive this error</p>

<blockquote>
  <p>redeemScript does not correspond to witnessScript</p>
</blockquote>
 48884: <p>At the time this question was asked, this issue was the result of a bug in Bitcoin Core. It was fixed in <a href="https://github.com/bitcoin/bitcoin/pull/18484" rel="nofollow noreferrer">PR #18484</a> and is available in Bitcoin Core 0.20+.</p>
