Forensics API currently hardcodes DEFAULT_BRANCH = "master" as the reference branch if not set with the referenceJob: or defaultBranch: parameter of the discoverReferenceBuild or discoverGitReferenceBuild pipeline step. However, the primary branches in many repositories have been renamed to "main".
Forensics API could search for PrimaryInstanceMetadataAction (source, javadoc) in the SCMHead instances. That would let it find the renamed primary branch without needing extra configuration. If no branch has PrimaryInstanceMetadataAction (because the SCM does not support that, or because the primary branch was excluded from the multibranch project), or if two or more branches have PrimaryInstanceMetadataAction, then Forensics API could still fall back to "master".