Have you updated the configuration so that the audience for your deep linking response is the test server rather than be production server?
For example in production you would normally have this claim in your JWT:
"aud": "https://canvas.instructure.com",
but on beta it should be:
"aud": "https://canvas.beta.instructure.com",
and test should just have beta replaced with test. Our tool that uses deep linking is working fine on beta, I can't check on the test instance as we don't have them configured for that instance, but expect it's working.
Have you ever had your code working against the test instance or has it recently stopped working?