Hi,
I don't fully understand what has been done so far.
Did you create an invoice and deleted that invoice before posting and when you try to invoice the PO again, you see that error?
Is that the process you executed?
Can you replicate this in a different demo/test system?
Best regards,
Ludwig