@pierov this isn't unique to the onion errors. We use the same "about:neterror" page.
I noticed this pattern:
open "about:tor".
Type doesnotexistdoesnotexist.com into the URL bar for the same tab ("about:neterror"). Light background.
Type https://self-signed.badssl.com/ into the URL bar ("about:certerror"). Light background.
Type http.badssl.com into the URL bar ("about:httpsonlyerror"). Light background.
Type "about:blank" into the URL bar. Light background.
Type "example.org".
Repeat one of the above urls. Dark background!
I've not noticed this with other "about:" pages. I think it is this color scheme override for "about:tor", which is in place because "about:tor" does not have light/dark variants, but we need to inherit one of them consistently from firefox styling. But I guess the next chrome error page inherits it as well!