This might be a corner case but have faced it and that caused bigger issue hence trying to find out how to approach the problem in the best way.
The Pihole dnsmasq component is set to query is set to query specific server in case of given domain:
That server is sometimes not responding in time (as connection depends on the VPN and couple of other details.
In such case, Pihole shouldn't respond to queries about hosts within this domain with it's own IP but simply return "not found: 3(NXDOMAIN)", unfortunately with default setup it comes back with it's local IP as it would be the case for blocking the ad host (just an educated guess from my end).
How get Pihole to behave?
Problems... well cause it redirects to local web server it causes all set of other issues in apps using servers via web on the other end up to the point forcing to remove cache from within the app which is painful to say at least for typical mobile user.
Thanks in advance for help.