Which tool are you using to find the XPath for a web element?
Earlier in my company we were using browser DevTools but recently we learnt that browser devtools is not the right platform to verify xpath, it gives wrong match count because it also gives string matches. Devtools also breaks in case of shadow dom, nested shadow dom, nested iframes etc.
Also there are n number of xpath tools available. But most of them are not perfect like xpath helper, chropath, xpath finder etc but they breaks in most of the cases.
Recently we came across a new XPath tool SelectorsHub which proven to work for all web elements and for all web applications.
Best thing about SelectorsHub is that it used to keep getting regular updates.
It supports shadow dom, nested shadow dom, nested iframe, svg elements and gives proper error message for invalid xpath.
It has smart editor feature which made it possible to write xpath within 5sec.
Another good thing it is available for all the browsers.