As per the question, I understood that you are invoking the third party service from Pega with the pan-number to get the required details. I think in your case, you are invoking either connect rest / connect soap for using the third party service and get the results if the pan number is valid.
Case 1: Pan Validation is performed at your end ( In Pega):
At your end, you have configured the validation of the pan-number to check if the entered pan number is valid or not. In order to find the validation of the panNumber, please check the action-set of the input text where you are entering the pan number or the submit button to check if there is any validation configured on the entered pan number. If you haven't found, then run the tracer when you are entering the pan-number or submitting the screen so that you will get to know at where the validation has existed.
Case 2: Pan Validation is performed at service end:
In this case, you can run the tracer on selecting all the rulesets on entering the pan number and check if there is any kind of step which checks for the pan-number validation that was performed if the details fetched by service are mismatched. In that step, there might be some kind of the jump condition configured which triggers the validation popup on the screen.
If you are looking to show the error message for invalid PAN number based on service, in the Response Data Transform we can check if the response is returning an error message and show the error message to the user.