Hi @CU01040835-0 ,
The error message clearly shows that its coming from a customization done. So first things first please don't try to reverse the prepayment voucher directly.
Try to create a vendor credit note for Invoice 3 using standard process.
Once Invoice 3 is credited retry to post the standard vendor invoice against two prepayment amounts which are settled already i.e Invoice 1 and Invoice 2.
If following above steps still shows the same error then you need to either disable the customization and check otherwise you will need to raise a ticket with Microsoft support but in that case its less likely that Microsoft support team will help as the issue is rising because of customization.
Please check if this helps and mark it as verified answer so that if anybody else is facing same kind of issue then this answer can be of help to them as well.