When a control is selected for automation, a snapshot is taken of its area. If this area is not at the top of the Z-Order, a snapshot is taken of the windows above it - just a screen snapshot. Therefore, the snapshot does not always show the element that is actually to be automated.
My suggestion is to put the window, which contains the UI element, first at the top of the Z-order automatically and then performing an informative snapshot. On this way I would always have the actual element “in my eyes” that is being automated.