After further attempts to pinpoint the cause of this bug, I have found that tramp-theme changes the current theme of emacs. (I had a testing variant of my main theme that had red foreground, and this was the reason I did not notice this before.) This behavior also happens with https://github.com/vic/color-theme-buffer-local , so I guess something about face remapping has gone awry in emacs@28.