Does its error message show exactly which part of the raw transaction is wrong and the bytes?
It shows you the error code. And then, you can find it in Bitcoin Core source code. And then, you can jump directly to the code, to know exactly, what was parsed, and what was not.
$ grep -r "superfluous" .
./test/functional/p2p_segwit.py: self.test_superfluous_witness()
./test/functional/p2p_segwit.py: def test_superfluous_witness(self):
./doc/release-notes/release-notes-0.18.1.md:- #15893 Add test for superfluous witness record in deserialization (instagibbs)
./doc/release-notes/release-notes-0.20.0.md:- #17537 Cleanup and move opportunistic and superfluous TopUp()s (achow101)
Binary file ./src/test/test_bitcoin-script_tests.o matches
Binary file ./src/test/test_bitcoin matches
./src/test/script_tests.cpp: "P2SH(P2WPKH) with superfluous push in scriptSig", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WitnessMode::PKH
./src/test/data/script_tests.json: "P2SH(P2WPKH) with superfluous push in scriptSig"
./src/txrequest.cpp: // requested and/or completed for other reasons and this is just a superfluous RequestedTx call.
./src/script/signingprovider.cpp: // Also note that having superfluous scripts in the keystore never hurts.
./src/secp256k1/examples/examples_util.h: * might try to eliminate "superfluous" memsets.
./src/support/cleanse.cpp: * might try to eliminate "superfluous" memsets.
./src/wallet/test/wallet_tests.cpp://! until after it is loaded. The notifications are superfluous in this case, so
./src/wallet/scriptpubkeyman.cpp: // Related CScripts are not removed; having superfluous scripts around is
./src/wallet/rpc/backup.cpp: auto subscript = std::move(import_data.redeemscript); // Remove redeemscript from import_data to check for superfluous script later.
./src/wallet/rpc/backup.cpp: auto subscript = std::move(import_data.witnessscript); // Remove redeemscript from import_data to check for superfluous script later.
./src/wallet/rpc/backup.cpp: // RecurseImportData() removes any relevant redeemscript/witnessscript from import_data, so we can use that to discover if a superfluous one was provided.
I wonder, which version of Bitcoin Core you have, because I cannot find the exact error message on master. But there are Python tests, including "test_superfluous_witness", so maybe it could help in reproducing the problem.
You can also try to construct a transaction with "createrawtransaction", and even sign it with "signrawtransactionwithkey" or "signrawtransactionwithwallet". Which means, that you can use some dummy example, and show it there, if you don't want to show real transaction ID and other real data. You can even use regtest, to make some dummy example from scratch.