I've encountered this problem as well. It appears to be related to a specific UI element (text panes that can display HTML) and I've only encountered this problem in IDE version > 2019.3. In previous versions of Intellij the font color used to invert automatically based upon the selected theme. I'm not sure what happened across versions of the IDE, but, for me, starting with version 2019.3 the font color no longer automatically inverted in text panes for me when I went from a light to dark theme or vice versa. But I have had some luck playing around with the custom fonts to get the fonts to invert the color in text panes based on the selected theme.
Try disabling the 'Use custom font' option in Preferences -> Appearance section and then restart the IDE. I tried this and once I restarted the IDE the font color inverted properly based on the selected theme. I was then able to re-select the custom font that I was using and restart the IDE again and it maintained the inverted font color. I am using Intellij and the Darcula theme. Hopefully this works with Material themes as well.
