Unclear index out of bounds assertion, when using multiple references in an Alexandria citegroup

Hi,
I am using Alexandria’s citegroups to collapse multiple bibliographic references. I have been doing so with no issues up until trying to include my last thesis chapter 6_Conclustions.typ. Here is a brief overview of my setup:
main.typ

#import "Config/lib.typ": thesis, loadBibliography

#show: thesis.with(title: ...)

#let chapters = (
  "1_Introduction",
  ...
  "6_Conclusions",
)
#for chapter in chapters.enumerate().map(
  it => { (int(it.at(1).first()), "Chapters/$1.typ".replace("$1", it.at(1)), it.at(0) < chapters.len() - 1) }
) {
  let (nth, thePath, shouldBreak) = chapter
  include thePath
  if (nth not in (3,)) { loadBibliography(str(nth)) }
  if shouldBreak { pagebreak() }
}

lib.typ

#let loadBibliography(n) = {
  let pref = "c" + n + ":"
  pagebreak()
  load-bibliography(
    "BIBLIOGRAPHY.bib",
    prefix: pref,
    style: "american-sociological-association"
  )
  // Modifing Appearence
  context {
    // Rendering the bibliography as instructed by
    // https://github.com/ensko/typst-alexandria/blob/3125e05e9dbf2dc802cd01baafd2331d67788b16/docs/manual.pdf#page=5
    ...
  }
}

// Here is the critical part!
// I use the following function to make references to bibliography,
// (singular or as a group)
#let bibref(refs) = {
  if refs == none { panic("refs == none") }
  if type(refs) not in (array, str) { panic("type(refs) not in (array, str)") }
  context {
    let prefix = "c" + str(counter(heading).get().first()) + ":"
    if type(refs) == str {
      ref(label(prefix + refs))
    } else if type(refs) == array {
      import "@preview/alexandria:0.2.2": citegroup
      citegroup(prefix: prefix)[#{
        for r in refs.map(it => ref(label(prefix + it))) { r }
      }]
    }
  }
}

#let thesis(
  // The thesis's title.
  title: [Thesis Title],
  // Parameters...
  
  body
) = {
  // Configurations..

  // Bind Alexandria's prefixes to the same `.bib` file.
  show: alexandria(prefix: "c1:", read: path => read("../" + path))
  ...
  show: alexandria(prefix: "c6:", read: path => read("../" + path))
  
  body
}

As said previously all worked well up until including chapter 6, where i got multiples of index out of bounds errors seemingly occuring at state.typ in Alexandria’s /src/, like the following:

array index out of bounds (index: 1, len: 1) and no default value was specified [Ln 116, Col 14]
lib.typ[Ln 135, Col 31]: error occurred in this call of function `get-citation`

array index out of bounds (index: 12, len: 1) and no default value was specified [Ln 116, Col 14]
lib.typ[Ln 135, Col 31]: error occurred in this call of function `get-citation`

I was unable to thoroughly debug and source the root of the problem nor did these errors hinted me in the right direction. Commenting out the citegroup part of bibref did not produce any errors but obviously sacrificing citegroups is not something in mind. Can you help me?

Thank you for your time!