The issue arises from the absence of a branchcode column in the acqorders table, resulting in null values within the 'Library' column of invoices.