not a RooFit expert here, but first question would be: what does “doesn’t work” mean?
Usually, problems with RooCmdArg, RooArgSet etc. is RooFit playing footloose with temporaries and from the looks of it, this is one of those cases: the const& going in ultimately gets cast to a non-cost ref and finally non-const pointer.
Such coding is “okay” in C++ under the assumption that the result of RooFit::Parameters is never stored, but only passed directly to a function. In python, however, the garbage collector tends to kick in earlier.
So, does the “doesn’t work” go away if you do something like:argset = RooArgSet(...)
RooAbsPdf::paramOn(frame, RooFit.Parameters (argset))
If not, please define “doesn’t work.”