Local DNS - override v6 addresses, don't forward a v6 request if a v4 entry exists

You are not looking for NXDOMAIN (meaning the entire domain does not exist) but a no-AAAA-record situation (NOERROR without any answer records).

As @Bucking_Horn already explained, the behavior is as expected: You overwrote a specific query type (A) for a given domain and any other record which is not locally defined is queried upstream. This is both desired and also desirable default behavior.

What you are looking for can be achieved by adding the custom dnsmasq line

local=/deb.debian.org/

specifying that this domain should be treated local-only and unknown records are considered non-existent.

With Pi-hole v6.0 (currently still in beta), this can easily be added in the config option:

With the current stable release, please create a file like /etc/dnsmasq.d/99-my-locals.conf and add the line there. Issue a pihole restartdns thereafter.