Hi Simon,
Are you using the DNX proxy on the Netscreen? If yes, then can you please try debugging the DNS proxy along with the debug flow basic, in the non working situation.
https://kb.juniper.net/InfoCenter/index?page=content&id=KB12208&actp=METADATA
run "debug dns proxy" after "debug flow basic"
Note: Use the proper IP filter before running the debug flow basic.
Thanks,
Vikas