If you create a multi-group model by simply embedding the group models in a container, be sure an add an explicit model name or put the fit function first. Otherwise mxModel will interpret the first parameter as a base model to update, and adding the multigroup function will cause a "cycle" - a reference that resolves back to itself.
works:
myModel = mxModel("twoGroups", m1, m2, mxFitFunctionMultigroup(c("female", "male")))
Fails:
myModel = mxModel(m1, m2, mxFitFunctionMultigroup(c("female", "male"))) Error: A cycle has been detected in model 'female' involving the following elements: ‘fitfunction’