There is one feature called "Background app management" , which you will find in "Settings -> Battery ; Background App management".
This turns on hibernation in the background for apps (not killing but sleeping), which may lead to notifications in some apps to be delayed (not outright cancelled).
You may disable this toggle - which turns the function off.
OR
You may choose which apps to not have this function by going into each corresponding app (longpress app icon) , expand the "Advanced" menu , press 'Battery' and then disable "Background app management".
This may have adverse effects to standby - our suggestion is to turn it off for apps which you care for "on time" notifications, or apps you find are having issues with this.
For GMAIL / GMS related notifications there seems to have been an issue from Google side (finding lots of similar threads online everywhere cross brands) which should have been addressed recently.