In the functional test rpc_psbt.py, some comments around the converttopsbt RPC checks are wrong or outdated and can be removed:
Error could be either "TX decode failed" (segwit inputs causes parsing to fail) or "Inputs must not have scriptSigs and scriptWitnesses"
Decoding a valid TX with at least one input always succeeds with the heuristic, i.e. this comment is not right and we can assert for the error string "Inputs must not have scriptSigs and scriptWitnesses" on the calls below.
We must set iswitness=True because the serialized transaction has inputs and is therefore a witness transaction
This is also unneeded (and confusing, w.r.t. "is therefore a witness transaction"?), for a TX with one input there is no need to set the iswitness parameter. For sake of completeness, we still keep one variant where iswitness is explicitly set to true.
Lastly, there is a superflous converttopsbt call on the raw tx which is the same as just about ~10 lines above, so it can be removed.