just use lockunspent with "txid":123 to reproduce

{
        already_witness = true;
        result = id;
        return true;
    }
    bool operator()(const WitnessV0ScriptHash& id)
    {
        already_witness = true;
        result = id;
        return true;
    }
    template<typename T>
    bool operator()(const T& dest) { return false; }
};
UniValue addwitnessaddress(const JSONRPCRequest& request)