Okay, so the warning is indeed a bug and shouldn't be printed at all. I will contact the dnsmasq maintainer to check what the best solution should look like and keep you updated!
Pi-hole will then likely push out an FTL v5.25.1 soon after. Thank you all for helping characterizing and confirming this bug! At this point I don't need anything more from you.
Summary: you can ignore the warning for now as it printed due to an inaccurate condition.
edit For the curious: this is how the bug is triggered in the code:
It is unclear at this point how to fix this best, but we will probably change the second quoted code block to not set log_resource in the REFUSED case.
Been troubleshooting the same thing yesterday but in a different context (router firmware that I maintain). What I've found is that if a DNSSEC validation fails, then dnsmasq returns a SERVFAIL, and that would trigger the incorrect log entry.
I spent some time on that code trying to better handle those SERVFAIL results, but it turned out to require more work than I was willing to put into, so for now I've simply moved that log entry to DEBUG priority instead of WARNING. Simon would probably be able to properly address this much faster than I could.
It seems your Pi-hole didn't have Internet access at that time - or name resolution was unavailable by other means. Your error message clearly states that this was a local problem.
The changes have already been merged into the beta codebase this morning (= ~ 15h ago). Everyone on fix/dnsmasq_resource_warning please checkout development-v6 to keep getting future updates. The v5.25.1 release is still awaiting further approvals before it can go live.
The bugfix has also been released as FTL v5.25.1 - please everyone who participated testing here - get back on track!
Use pihole checkout ftl master to receive the new update if you are still using Pi-hole v5.
Use pihole checkout ftl development-v6 if you are participating the the public v6 beta.