I experienced the same issue as you.
In devices connected in Debug Mode, FCM's OnNewToken() and OnMessageReceived() were called successfully, but in the Release Mode app, they were not invoked.
This is because, starting from .NET 7.x, unused code is trimmed during the build process due to the use of the linker. FCM Firebase relies on dynamic linking and calls functions later when events occur. However, during compilation, the linker considers these functions unnecessary and removes them to optimize the app.
Although there isn't an exact solution yet, you can resolve this issue by adding the following settings to your .csproj file. Add or modify the following within the section:
<RunAOTCompilation>False</RunAOTCompilation>
<PublishTrimmed>False</PublishTrimmed>
This disables trimming during deployment, ensuring that dynamically called Firebase functions are retained. However, keep in mind that the size of the deployed app will increase as it won't be optimized.
Refer to the following link for more details: