I don’t have time to look over this in detail right now, but since it sounds like you are replicating much of BibLaTeX’s functionality, does this mean your citatoins/bibliographies handle year disambiguation? Because so far, even with modifid .CSL files, that is currently a problem in Typst’s built-in citation handling: