This happens in a Synology NAS, which I understand is not a supported platform. However, I hope this is not related to the platform, but to some setting...
I had this happen to me... and I think it was due to a ‘secondary DNS server’ setting that I had in DHCP. The router didn’t like only having one DNS server, and would use itself as the secondary DNS server. When the client queried pihole it didn’t return anything, but at the same time the router was being queried, and returned the address of the blocked content, so the client used that.
Make sure that the pihole is the only DNS server that the client is using, and try the query again. I ended up having to put pihole in my DNS settings twice [same IP address] to get it to work, and I am using a Draytek router.