Can you void it instead of deleting it? If not, make it a blank or zero dollar invoice to a bogus customer.
Edit
And this should only be an issue if it was the last invoice in a group, as the “next” invoice number is selected as the last existing one, plus one.
We used to have a group called PROFORMA, and never post them. It would “reserve” the invoice num. We’d clean out old invoices after they were a week old - or when we knew that newer real ones were created.