DNS Resolution fails inconsistently with IPv6

I recently got a new IPv6 (and WiFi 6) enabled modem, and it seems to be causing some issues exclusively on my NixOS installs (I have confirmed it is only my NixOS devices that are doing this). Programs will choose (seemingly arbitrarily) between using IPv4 or v6. If they choose v6, they will occasionally fail to resolve hostnames, despite having both v4 and v6 DNSs configured in my configuration.nix as such:

networking.nameservers = [

I believe it to be a DNS-related issue, because when I tell Firefox to force using its secure DNS, the problem disappears on Firefox specifically.
Is there anything else that I’m missing that might be causing this behaviour? It’s really frustrating and seriously hurting my productivity (including not being able to run nixos-rebuild).