I don't know if this has always been the case and I just haven't noticed, but under iOS 15.2 at least, iOS switches to mobile data/4G as soon as it hits a DNS resolution issue.
I've verified this by visiting a Google Ad result - switches to 4G and renders the page. If I turn off mobile data, the page is blocked and I stay on Wifi.
Similarly if there is a blocked request on any page I'm switched to 4G.
Is this new behaviour?
My router is giving out the address of the Pihole for DNS resolution, but if I change the iOS DNS settings from automatic to manual it seems I can prevent this behaviour.