B2B and B2C sent simultaneously

Hello @Ankit_Tiwari
We bill patients and insurance for the same medical procedures. we invoice B2C and B2B together. In our system it is a single invoice for the item. but the item is paid by both customer (patient) and business (insurance).
Hence we have to send B2C and B2B at the same time, separated into 2 invoices for ZATCA though it is a single invoice for us.
What if one of them fails eg B2B fails on ZATCA reporting and B2C works fine OR there is no internet connection. B2C will be invoiced to patient. later when connection is on the B2B might fail and B2C will go through. but we have already generated a single invoice in our system and provided it to customer.
How do we handle this? does anyone else have a similar issue?