After creating a multisig transaction containing only metadata (no asset data), sometimes I randomly get a "previous output ScriptPubKey mismatch" error when I try to sign the transaction. Most of the time it works fine, but sometimes I get that error. Posted below is a screenshot of the error. decoded info is from decoderawtransaction. When signing, I am passing in the extra parameters (txid, vout, redeemScript, and scriptPubKey) along with the raw tx object from createrawsendfrom and the private keys. However, I am not sure if I am obtaining the extra parameters properly.
The error:
"Previous output scriptPubKey mismatch:
OP_HASH160 0e2acee2307892bcf2ea66e3f321b34979e24bf8 OP_EQUAL 73706b65adfb3830d91629f70b8b29cf1fc36fbd OP_DROP 73706b700800000000000000ffffffff0b507a59 OP_DROP
vs:
OP_HASH160 0e2acee2307892bcf2ea66e3f321b34979e24bf8 OP_EQUAL
500"