I need to point out an error in your thinking.
Component Instances do not “have” entities. It is Component Definitions that “have” (or “own”) an
All instances of a certain definition will share the parent’s entities collection.
So you’d actually move a group instance, into a definition’s entities collection.
Perhaps something like:
cdef.entities.add_instance( grp.definition, grp.transformation )
But there was some caveat concerning context. I cannot remember off hand what it is.
Perhaps @TIG knows ?