I wasn't necessarily saying that that particular trope applied to Star Trek, but it certainly was a common thing, esp in horror movies.
It really wasn't. If anything, black people were underrepresented in the horror genre and barely appeared in them for the longest time. The idea that "the black guy always dies first in horror" is rubbish made by revisionist black journalists who have barely even seen any horror movies and are looking for pity.
I'm thinking in my head right now of the 10 or so most famous horror movies and most of them don't even have a black character (Psycho, Halloween etc). Others do but the black guy is competent and lasts a fair amount of time (Alien). The Shining is the only one that even fits the rule you mention.