just use lockunspent with "txid":123 to reproduce

{
public:
    CWallet * const pwallet;
    CTxDestination result;
    bool already_witness;
    explicit Witnessifier(CWallet *_pwallet) : pwallet(_pwallet), already_witness(false) {}
    bool operator()(const CKeyID &keyID) {
        if (pwallet) {
            CScript basescript = GetScriptForDestination(keyID);
            CScript witscript = GetScriptForWitness(basescript);
            SignatureData sigs;
            
            
            
            if (!ProduceSignature(DummySignatureCreator(pwallet), witscript, sigs) ||
                !VerifyScript(sigs.scriptSig, witscript, &sigs.scriptWitness, MANDATORY_SCRIPT_VERIFY_FLAGS | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, DummySignatureCreator(pwallet).Checker())) {
                return false;
            }
            return ExtractDestination(witscript, result);
        }
        return false;
    }
    bool operator()(const CScriptID &scriptID) {