Applying transform through EditElementHandle causes Element descriptor to change

Hello, I have a following problem: weird behavior is happening on Opencities (link to question,https://communities.bentley.com/products/geospatial/desktop/f/bentley-map-forum/238486/changing-scale-of-a-cell-causes-the-subelement-line-linestyle-scale-to-change-as-well). As I got no question, i had to pick a thorny way of code workaround. My idea is :

  1. Create a cell element descriptor that will be placed into the model.
  2. Iterate through the cell header to find its child elements, check their linestyle scale and change it to 1.
  3. Write the cell to the model.

For some cells, this approach worked. However, I found out strange behavior.

    MSElementDescrP descrP; //lets say this is my element descriptor
    EditElementHandle handle(descrP, false, false);
    TransformInfo info(*userTrans);
    
    int res =  handle.GetHandler().ApplyTransform(handle,info);

In some cases (I don't know what causes this behavior) the address of element descriptor changes. Not only that, but if I check the structure of the original descriptor(that is, before it calls ApplyTransform method), the first element link totally disappears - it is set to NULL(firstElem). EditElementHandle contains element descriptor with whole new address and first element is there correctly(also on new address). I understand that the EditElementHandle is smart wrapper around old C style element descriptors, so it may handle some move inside movements and allocations. That should be fine.

As I work with older code base, that has many functions that work with element descriptors, I was forced to get the new element descriptor from the EditElementHandle(via getElementDescrP() function)

Everything is fine, however! When I add the said element descriptor to the model, suddenly two elements appear: the original non changed cell and then the new version with adjusted scale. Why is that happening when i work only with the new element descriptor ?

Thanks for any kind of input.