Dear Em Jay,
I am not able to give you a straight to the point solution.
I tried replicating your issue in my system, but fortunately it is getting picked all the time. it would be better if you compare the sucess case and failure invoice with ABAP de-bugging help to find the root cause.
Regards,
M S Lokesh