I have similar problem, and I found the reason why.
In this page:
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains
They said:
only apps signed with a development profile can use developer mode, and users must opt in on any device they use.
So you must use development provisioning profile, or make association file public.
I suspect that you are using AdHoc profile or InHouse profile for TestFlight deployment so that testers can use it. It is same situation to me.
(Eventually, we are trying to solve with making only the association file public)