Hi thanks for your question at Q&A. I understand that you are working on an Azure Policy to enforce certain tag name/value pairs not being present.
When developing policies the approach a usually take is to keep policies simple by not attempting to make them to generic when its easier to write a more purpose fit policy instead. In this case the approach I would take is to create to 2 separate parameters for the ClientCode and Environment and use those parameters to check for the specific tags instead of trying to find them dynamically.
If you need to make sure of multiple combinations of these ClientCode/Environment pairs you can make a policy assignment for each unique combination.