Since the addition of "doze" on recent versions of Android, notifications of new messages from Gmail can have a delay (from several minutes to a few hours). More here. Since Android 10, it is possible to add gmail to the white-list of "doze", without this setting being forgotten at each startup.
Verify that you are connected to your device with adb by using the following command:
adb devices
NOTE: If adb replies that you are not authorized, you must authorize the connection from your Android device.
Add gmail to the whitelist with the following command:
adb shell dumpsys deviceidle whitelist +com.google.android.gm
You can check the applications in the white list with the following command:
adb shell dumpsys deviceidle whitelist