I have a repository item named CreateRx. When highlighted, this control is found without any problems.
When executing a simple click command on the same item, Ranorex finds another control in the application that is not in the same XPath.
Executing the same script, but with a hard coded XPath from the Repository, it finds the right control.

When I changed automationid='f20d7ebdb11447c8bcff9dc3455c94f7' to another id, the highlighting was fine.
refpath was also changed and it looks that everything was fine.
But, the toolbar id also changed and this made is impossible to find it at runtime.

This is the final control after the refactoring and putting “Simple” as the Ranorex XPath generation mode