Looks like this is an issue with the Xero API. This was a reply I received from them directly:
Our product team are currently aware of a behaviour where POST requests to update an existing invoice cause any DiscountAmount entered in line items to be recalculated as an incorrect DiscountRate.
Currently the workaround to prevent this behaviour from occurring is to include the LineItems, including the original DiscountAmounts in the request body of the POST request, so that the original DiscountAmount is maintained.