You are right, the story can be good even with flat characters, but personally I end up rereading and rewatching ones where all the characters are vivid with their good and bad sides.
Such as First law trilogy by Joe Abercrombie — every main character is a fucking living person