Fixture ID: chargeEmpty · XPath: /ubl:Invoice/cac:AllowanceCharge[1]/cac:TaxCategory/cbc:ID
The document level charge at charges[0] has no VAT category code (BT-102): you supplied missing. A document level charge is not a neutral adjustment to a total — it enters the VAT breakdown on its own account, adding to the taxable amount (BT-116) of exactly one category-and-rate group. Without a category there is no group to put it in, and the document's VAT would silently disagree with its totals.
BR-37Set charges[0].vatCategory to the category of the supply this charge relates to — "S" Standard rated, "Z" Zero rated, "E" Exempt from VAT, "AE" Reverse charge, "K" Intra-community supply, "G" Export outside the EU, "O" Not subject to VAT, "L" Canary Islands general indirect tax (IGIC), "M" Tax on production, services and imports in Ceuta and Melilla (IPSI) — which should normally be the category of the lines it adjusts.
"vatCategory": "S", "vatRate": 19