Code-switching is a linguistic skill that isn't taught formally. You bootstrap it or you're screwed. Some kids -- I would bet they're the ones with strong linguistic and/or social skills -- pick it up quickly and easily. Other kids, and I would expect this affects the visual and tactile learners who already aren't great with talking and reading -- can't get the hang of it. So what happens is basically the same as any other group stuck working in a foreign language they don't understand well: floundering.
I bet this explains some of Shiv's difficulty in school. He's pretty thick into the overlap between blue-collar and black English. It's not as much as the Deep South or ghettos in the coastal cities, but it's plenty enough for people to look down on him. And the gap shows all the more now that he's picking up phrases from a completely different register: upper-middle-class Californian with a liberal dash of geek. Boss White can code-switch fluently, though.
Just in case this needs saying: Everyone speaks with an accent. Some are more widespread than others. Some are more fashionable than others. Like languages, some dialects are a little better at certain things than others -- such as the definitively completely past tense of "done gone" in Southern English -- but you can talk about anything in any of them. As far as linguistic science is concerned, all languages and all dialects are equal in value and competence. So when anyone mocks another person because of how they talk, that is discrimination, not science. Science got no beef wid yo talk. Science don't see nothin' wrong thisaway neither. So neither should people.