It is highly likely that there is an issue in the process of uploading the FCM token during the first login.
FCM tokens are issued per device and remain consistent unless the app is uninstalled. Therefore, re-logging in does not typically change the FCM token.
In this case, notifications work after re-login, which suggests that the FCM token was successfully saved to the backend during the second login.
As such, I recommend reviewing the process for handling the FCM token during the initial login.
If you can share the details of how the FCM token is saved during login, I can provide a more specific explanation of the root cause.