Writing builds character. Or is it the other way around? The sad thing is that too many characters are caricatures that fulfil an odd addiction of an audience to do as predicted, to make everyone satisfied in knowing what is done next.
The core of real character is outside the details and patterns we project. Characters are inconsistent. They must be. They must be what is not expected. (And then not.) That is how we behave, what we need to understand our traumatized self.
As predictable as we might think people are, we aren’t. And if we are, that is death. A character needs to be nebulous. It is in that that a story spirals light.