What makes you believe that "the primary target for the element is different depending" is actually the problem? Do you get an error message? What does it say?
To explain in more detail, the Primary Target you're looking at is nothing more than a path to an element contained in our repository and that element has a Find Expression. It's this Find Expression that Test Studio actually uses at runtime to locate the right target element on whatever page happens to be currently loaded in the browser at that time. Test Studio actually doesn't test, doesn't care what page is currently loaded. As long as the find expression for both elements (UATCAPisHub versus DEVCAPisHub) is identical the test should work just fine.
Lastly we have this KB article
describing how to design tests to run in multiple environments. We also have this KB article
showing you how to merge duplicate page nodes together.
If you still need assistance please let the test fail then go to Step Failure Details
, find and click Export then attach the generated .zip file. It contains valuable information we need to diagnose this type of failure.