fits2caom2 tries to use CROTAi keywords to create a CD matrix if it doesn't exist; the magic should be removed so the caller will be responsible for providing the CD matrix.
Code to calculate the CD matrix from CDELT/CROTA should be part the data engineering libraries and only enabled in pipelines that need it and can verify correctness.