Aspose.Pdf for Java doc appending problem

Hi,
when trying to append attached docs signature.pdf (17.3 KB)
content.pdf (982.1 KB) aspose is throwing following exception:
class com.aspose.pdf.internal.ms.System.z72: List contains object of invalid type
com.aspose.pdf.PageCollection.m1(Unknown Source)
com.aspose.pdf.PageCollection.add(Unknown Source)
com.chitasys.PdfAppend.main(PdfAppend.java:49)
at com.aspose.pdf.PageCollection.m1(Unknown Source)
at com.aspose.pdf.PageCollection.add(Unknown Source)
at com.chitasys.PdfAppend.main(PdfAppend.java:49)

It is interesting it only happens when appending to signature.pdf but not other way around.
I tried this with v17.7 & v17.8

Code snippet:
// signature last
File outputFile2 = Paths.get(“d:\temp\pdfissue\joined-siglast.pdf”).toFile();
outputFile2.delete();

		try (
				InputStream is1 = new FileInputStream("d:\\temp\\pdfissue\\signature.pdf");
				InputStream is2 = new FileInputStream("d:\\temp\\pdfissue\\content.pdf");
				OutputStream os = new FileOutputStream(outputFile2)
		) {							
			Document sig = new Document(is1);
			Document doc = new Document(is2);
			
			doc.getPages().add(sig.getPages());
			doc.save(os);
		}
		
		
		// signature first - this one throws exception
		File outputFile1 = Paths.get("d:\\temp\\pdfissue\\joined-sigfirst.pdf").toFile();
		outputFile1.delete();
		
		try (
				InputStream is1 = new FileInputStream("d:\\temp\\pdfissue\\signature.pdf");
				InputStream is2 = new FileInputStream("d:\\temp\\pdfissue\\content.pdf");
				OutputStream os = new FileOutputStream(outputFile1);
		) {

			Document sig = new Document(is1);
			Document doc = new Document(is2);
			
			sig.getPages().add(doc.getPages());
			sig.save(os);
		}

@konopka,
We are unable to replicate this error in our environment and the PDF file is being generated without any issue. Kindly create a small project, which reproduces this error in your environment, and then send us a Zip of this project. We will investigate and share our findings with you.

Here is the sample project, but change the outputpaths, license is not included
pdfappendissue.zip (841.7 KB)

@konopka,
We are working over your query and will get back to you soon.

@konopka,
We managed to replicate the said error in our environment. It has been logged under the ticket ID PDFJAVA-37077 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.