I get a modeline with the default color. After Emacs has already
started, evaluating that first line again produces the expected
result. Is this some corner case bug?
M-x customize-face RET mode-line
This, as expected, does not solve the problem.
You mean, if you customize the mode-line colors as you wish them to
be, then save the customizations for the future sessions, and restart
Emacs, the mode line again comes up with default colors?
I can understand why set-face-background doesn't work in your .emacs:
when Emacs processes those lines, the modeline face does not yet
exist; you could fix that by, e.g., creating it with make-face. But
saving customizations with M-x customize should solve that problem (in
a different way), so I'm puzzled by ``does not solve the problem''.