Issue with Attribute Positioning in Block Reference

Hi team,
I am currently facing an issue after modifying the attributes in a block reference. The problem arises as the attributes are drawn at an incorrect position, despite the code working correctly in AutoCAD.

I have attempted various solutions, including "regen," AcDbEntity::draw(), and updatedisplay, but unfortunately, none of these have resolved the issue. The only effective workaround so far is manually moving the reference, which corrects the attribute positioning.

A code fragment and some screenshots were attached.
Thank you for your time and assistance.

Best regards,
William.

/////////////////////////////////////
maybe you should use:
AcDbattribute::adjustAlignment to adjust Attribute Positioning after modifying