Welcome to Android Central forums. I don't want to say it is never the device limiting the number of notifications but I will say that it is almost always the app itself. I actually had this discussion and debate back in 2020 where we proved that some apps can display over 100 while others only displayed 20 or 30.
You mentioned 24, would the app in question be Twitter? Twitter starting with Android 10 began limiting their app badge/notification count to 24. YouTube 99, a few email apps 100+, and I believe someone posted a screenshot of an app with over 300 . It is the app not the device or it was in those cases.
I could only find two threads that I participated in talking about this but neither appear to be the one I'm thinking of but you can see them for yourself here in these links.
Good morning, The Whatsapp app icon shows the number of unread messages (in my case 20) I get 1 message, only instead of showing 21 unread messages, there were always 20. I then clicked on the new message and the unread message counter remained 20. What happened? I hope I have been clear;
forums.androidcentral.com
I was recently caught up in a debate over why someone's Twitter was only showing 24 notifications on an S10+. It's been forever since I've allowed notifications to just stack up but I've seen notification badges up to 99. I said, if this only seems to happen on Twitter it's the app. Someone...
forums.androidcentral.com
Hope this helps.