Yes, a 40% black district would elect a democrat. But would a black democrat get through the primary? Probably not.
That is highly likely. If you didn't notice, Black Democrats just got elected in quite a few seats with much, much smaller African American populations such as NY-19, GA-06, IL-14, TX-32, and CO-02.
So yes, a Black Democrat would have a great chance at winning a Democratic primary. That doesn't mean a Black Democrat would be
guaranteed to win, but that is never the case. Ask Bill Jefferson of Louisiana. If they didn't win, it would almost certainly be because there was something wrong with their candidacy, not solely because they are black.