The UniqueNumbers implementation is based on database sequences and doesn’t guarantee a continuous sequence without gaps. It guarantees only uniqueness of the values.
So it could be that #4 was acquired but the document was not saved due to some error and transaction rollback.
Usually, you cannot just decrement the sequence on an error, because if another user already got another number, it would break uniqueness.
To have a unique sequence without gaps, you have to block on some database record which contains the current number. Think twice before implementing such an algorithm, because it can seriously affect performance.