Just to see what screen does, I straced it. Seems it maps both back and foreground of 38;5;nn and 48;5;nn into 30/40 and 90/100 for 0 to 15. Attached a new file that shows what the test program outputs, what screen reads in, and what screen writes out.

Even though the surrounding terminal supports 256-colors and thus 38;5;nn escapes, screen seem to rewrite those sequences for at least colors 0 through 7 to 30+nn instead. This causes color errors when combing whith bold (1) as 30+nn together with bold usually maps to colors nn+8, and thus any of the first 8 colors is then displayed as bright intensity in addition to bold.

See the two supplied images, the first showing how gnome-terminal displays the colors (and how they should be), the second how the same output in screen causes translation of escape codes an thus the display of wrong colors.