Element.IsComposite
is read/write. Setting it to 1 will create a composite diagram of the appropriate type, unless the element already contains one (in which case that will become the composite diagram).
Element.CompositeDiagram
, on the other hand, is read-only. So you can't first create a diagram in some arbitrary location in the model and then set the element to point to it.