Hreflang tags that work for some pages but not for others.

Hello

We have our site configured with several subdirectories of countries. We have hreflang tags on all sites. It mostly works fine, but in some regions, the UK or .com pages are displayed instead of the local versions of Canada / Ireland. We know that everything is configured correctly, since it works for 80% of the pages. Our website agency has also confirmed that everything is configured correctly.
SEMrush

Does anyone know why the incorrect pages of some of our keywords are displayed? It's just happening in a few pages.

It drives me crazy! Also, the keywords do not show data in ahrefs since the local website is not shown, but we are actually ranking second or third with the UK or .com domain. For 30 monitored keywords, this only happens for 4-5.

Thank you