We keep seeing refunds booked as invoices with negative lines. Any receiver that reads the amount instead of the document type will book that money twice.
A refund is a credit note: positive amounts, direction carried by the type. Reject negative totals at your own edge. Better you do it than someone downstream.
https://shipmindlabs.com/c/77cc04c4