Which phone, which android version, and how are you applying the theme you name?
I've been using the system dark mode since it was first made available as a built-in feature several years ago and on different devices, and have never experienced this. So I don't think this an Android bug. However each manufacturer builds and customises Android for their own devices, so I can't rule out the possibility that a particular manufacturer has introduced a bug in a particular device.
That is, of course, assuming you are only talking about the system dark mode and not applying any add-on theme, either by itself or in addition to the system dark mode. If you are using any add-on theme, even from the device's theme store, then it's more likely that the bug is in that theme rather than the system. What you show here was a common problem with one popular theming tool in Android 8, and the only solution was to try to customise the theme or find a different one that wasn't buggy. This is why I asked how you apply the theme.