persönliche Erfahrungen habe ich damit nicht aber vielleicht hilft dir ein Verweis an diese Stelle weiter?
https://bitcoin.stackexchange.com/questions/95490/error-26-mandatory-script-verify-flag-failed-signature-must-be-zero-for-faile
Auszug davon:
Quote
The problem is that you are serializing the transaction for signing incorrectly. The data that is signed is not just the raw transaction with the sighash appended to it. You need to slightly modify it too. Specifically, for the input currently being signed, you need to put the scriptCode into that input's scriptSig. The scriptSigs of all other inputs must be empty.
The scriptCode is the scriptPubKey of the output being spent by that input except for P2SH. If the output is a P2SH output, then you need to use the redeemScript.
The scriptCode is the scriptPubKey of the output being spent by that input except for P2SH. If the output is a P2SH output, then you need to use the redeemScript.
Der Link zeigt noch mehr relevante Infos.
Sonst auch gerne hier lang zu den wirklichen Profis in zu diesen Themen: Development & Technical Discussion (z.B. hier gab es das Thema auch schon)