When you delete an appointment, it also deletes the invoice linked to it. If you need to delete an appointment but keep the invoice it generated, you can simply unlink the invoice fee from the appointment.
Open the invoice.
Under the Fees and Charges section, next to the fee, click the Edit icon.
In the Edit Invoice Line pop-up, under Appointment Details, click the Remove icon to unlink the appointment from the invoice.
The invoice and the appointment are now unlinked. You can now delete the appointment without affecting the invoice.