I looked at the documentation of AccessibleObjectFromWindow and I didn't understand the usage of it and what it does and how it could help me with my strange problem.

Can you elaborate please?