Aha, that feature is called bedtime mode on my phone, interesting 😄
But yeah, configure dnd mode not to show notifications and that's it. If you need notifications from certain apps, add exceptions.
I wouldn't call this a bug, maybe a missing feature. Don't get your hopes up about it getting added.