This is generally the case, especially in presidential politics. However, the black vote in Democratic primaries is not as monolithic or ideologically fixed as often stereotyped. There is a recent trend of black insurgent candidates doing quite well in or getting their primary base of support from majority-black precincts in downballot races where their primary opposition is a white establishment candidate (Jamaal Bowman, Summer Lee, and Brandon Johnson are a few examples of this phenomenon).
Black voters almost support the black candidate over a white candidate, regardless of ideology. So they supported far-left Brandon Johnson over centrist Paul Vallas and former Republican Eric Adams over establishment progressive Kathryn Garcia.
Not sure this is always the case. Back in 2007 and into 2008, Obama was actually behind Clinton with the black vote and his team was even upset black voters didn't automatically back him. It wasn't until he win in predominantly whit Iowa that African American voters begun to shift as they were assured he could win a national election. It will be interesting to see how this impacts the Maryland senate primary this year.
Maybe they saw Obama as unfavored on a GE before the Iowa primary (and they wanted a democrat to win).