This is an issue with the introduction of doze. I can confirm that on every single Android phone I've used since doze was introduced "think it was marshmallow, could be wrong". I have experienced this issue with all my pixel phones up to 4xl, Galaxy s21 Ultra, and OnePlus 7 Pro and 8 Pro. Executing "dumpsys deviceidle disable" via rooted device in terminal or the adb command via computer fixes the issue 100% every time. I also experience no extra battery drain. Google simply needs to get rid of doze it's no longer needed. I carry an iPhone along with my android of choice and only when device idle is disabled do I get my notifications instantly just like I do without fail on my iphone. It's very depressing to have to jump through hoops to get important instant notifications on an Android phone.
If I were to guess, all your notifications go through gooble, right? Software that gets notified directly doesn't have the doze problem because those programs can be selectively granted unrestricted battery access.
But the goog notifications problem is that there are a bunch of separate parts that it has to feed through, and while they do force some of it unrestricted, it seems that the unrestricted state misses some important component.
The ultimate solution, therefore, is to wean yourself off of goog.