It is however possible for most record types to exist
with the same label, class and type, but with different data. Such a
group of records is hereby defined to be a Resource Record Set
In other words, an A record and a AAAA record can not co-exist in a single RRset by definition (they would be two RRsets). If you have an example of what you are encountering, that might clear things up.
great that the issue with zero TTL is already being worked on. Much appreciated!
About the second issue: Most systems are dual stack these days. So the system’s resolver (and in this case systemd-resolved as part of it) sends two requests to resolve a domain, one for A record and one for AAAA record. If the domain name is a CNAME both records are answered with the same data (another domain name), but (possibly) with a different TTL. Both answers are handled as one RRSet, and different TTLs for the same data are tolerated - unless one is zero and the other non-zero.
The check for this is what I referenced in code in my original post. Not quite sure this is even technically correct. Can one RRSet consist of two queries and answers. I guess Cloudflare sends this through a load balancer and answers come from different nodes, no?
However… The issue will go away when TTL is no longer zero.