Function arguments returned as functions.functionName({JSON}) rather than just {JSON}

I have an assistant that only does one thing, which is parse a Pdf and call a function called processPurchaseOrder, however, when processing one pdf the assistant returns the function argument as functions.processPurchaseOrder({JSON}) rather than just {JSON} which then cuases the whole flow to fail. the weird thing is that this only happens for one specific pdf, other return just the {JSON} as expected. The data from the pdf which fails is parsed correctly.

What is the reason?

Welcome to the dev community.

Can you notice any differences in the PDF that’s working and the one not working?

the PDFs are purchase orders from 2 different companies. visually they are different, however, GPT seems to be parsing/understanding both of the PDFs well since it is correctly extracting info, the only issue is that for one of the PDFs it has the weird output.