I copy/pasted yours in my Userchrome.css, saved the file and restarted Joplin.
Codeblocks are still light grey.
I have no plugins installed.
I use OLED theme but in other themes it does not work either...
I think this occurs because the dark theme stylesheet within Joplin itself uses !important so your css will not over-ride it. Another user suffered this and that time I found that using a more specific css element can over-ride an earlier !important statement.
pre.CodeMirror-line span[role="presentation"] span.cm-comment {
/* code text - dark theme override*/
color: red !important;
}