You can freeze the document numbers by selecting the documents from the folders:

Then click on “Bulk Actions” and select “Freeze numbering”

You will see a lock icon next to the frozen documents

If you add new documents, you will see that these document numbers will be updated to respect the document numbers of the frozen documents:

Whenever desired, you can unfreeze the number by replicating the first steps and selecting the “Unfreeze numbering” option.