Let’s show the issue.
I have the fresh Business Central (BC) tenant (14.0, online version) in my hands.
I use default set for Number Series:

Go to ‘Item Card’ (1925-W), set
- “Prevent Negative Inventory” = yes
:

Create new ‘Sales Invoice’
Header:
- Customer = 10000
Line:
- Item = 1925-W
- Quantity = 1
Try to post, as result error:
“You have insufficient quantity of Item 1925-W on inventory.”
:


Check that in the document (unposted document) we could see “Posting No.” = 103215
// use Page Inspection feature (this is the new feature for 14.x version)



You can see 2 key fields in Sales Header (36) table:
“Posting No.” (63) [use for Posted Sales Invoice]; “Shipping No.” (62) [use for Posted Sales Shipment]
// for Purchase side similar story - Purchase Header (38) table:
// “Posting No.” (63) [use for Posted Purchase Invoice]; “Receiving No.” (62) [use for Posted Purchase Receipt]
Why system work like this?
---
…
This is an old system behavior.
My personal understanding (based on some old support cases):
‘Next No’ from Series is got at the beginning of posting instead of ending.
This is done for multiple / partial posting and to be sure that in case of two or more simultaneously posting
at the same time there won't No Series intersections between different documents.
The issue has been discussed before and DEV team aware about this story.
Now I see a new round of the discussion in this Idea:
https://experience.dynamics.com/ideas/idea/?ideaid=be8f5c48-4955-e911-b047-0003ff68d113
---
Let’s continue. Let’s create a gap.
Create new ‘Sales Invoice’
Header:
- Customer = 10000
Line:
- Item = 1980-S
- Quantity = 2
Post
:

Go to ‘Posted Sales Invoice’
We could see a gap
:

Key moment that if we Post the document (document has “Posting No.” <> ‘’) or Delete the document then we close the gap.
But wait a bit and now I show how to find the potential gaps –
A user can filter the document list where “Posting No.” is <>’’. That will provide the documents with Posting No.
:



Another option is to run the table from the link and get the data there
// For direct connect to the table just manually add parameter “?table=36” to your link
:


Now, we ready to show what happen if delete the document (document has “Posting No.” <> ‘’)
// you could also close the gap if Post the document (102222)
:


// message: Deleting this document will cause a gap in the number series …

// message: One or more related posted documents have been generated during deletion to fill gaps in the posting number series …


// system create 'an empty document with the only text line "deleted document"' 103215 - as result no gap
The same story for Posted Sales Shipment
:


My example based on Sales scenario (table 36), but you could apply this for Purchase scenario too (table 38).
P.S.
General useful link (maybe): [INFO] Useful links https://community.dynamics.com/business/f/758/t/307965