I have a unique ID (NabejanID) for each user in my service.
As you can see in the captcha, the first user registration form is automatically set to the maximum value + 1, but often the IDs are covered and I have to manually modify the database.
You can rely on the user:id that will always be unique, it will save you actions, and will always work.
Otherwise, I would move that +1 onto an action on another screen, once the user is signed up and logged in. You need to allow time for such operations otherwise you’ll face these issues. You can’t rely on stacking them straight after the signup or login process.