Dimension by reference, part dimension invisible

Hey guys,

ive made a script where we dimension by references and most of the times it works perfectly but sometimes it places dimensions where part of it is invisible.

image

Cant get this last part visible, not even in Revit by using edit witness line. Other times (most of the times) the result is like below and does the job perfectly.

image

This is the same script used one time on the same family but different types. The type differences are only in length between the end of the rectangle and the first circle.
Havce any of you guys had this problem ?