My gut is telling me this might be caused by something in the data you are using...special character or something....Can you run this for a batch of lines at the time? Maybe cut the dataset in half.... then half again.. etc... That would help you pinpoint the error in the data.
Yes the invoice lines we received on one particular day has some special/junk characters which is the reason it is throwing an error. But the problem is, there are around 36K invoice lines on that day which is making it difficult to pinpoint that particular invoice line. Please suggest.
Please refer the following Oracle note, which seems to be similar and may be helpful to your issue :
PO Output For Communicate XML Fails With ORA-31061 - Solution For Special Characters (Doc ID 1346198.1)
Guide to Solve ORA-XXXXX Issues in Procurement (Doc ID 1522654.1)