So, I've been thinking about this for a while and I guess what I really want to ask is a couple questions: first of all does your character have a flaw or is your character flawed? I've read books and seen tv and movies where characters are injected with one or more flaws not because they really make sense but as a substitute for depth.
There are a lot of cheap tricks to avoid giving characters legitimate depth.
The whole cast of my sci-fi story is seriously flawed. None of them are batshit crazy, but they have over years of tough experiences developed various pathological tendencies that make harsh amoral behaviors their first choice in any situation. They are very much the "Bad men doing the work of the good guys"
By contrast in the fantasy piece I'm working on the heroes are genuinely good guys. They may like to complain a little and they put on tough fronts, but they are the heroes who do the right thing because it's the right thing.
I think one of the key factors in the differences of the two sets of characters for me is faith. In the sci-fi piece most of the characters have no real faith or have lost any that they might have had. God, if God exists at all, is seen as remote and uncaring. In the fantasy piece there are deities and magic active in the world so there is hope and faith and motivation to be better.
(Please note that my "if God exists at all" is intended solely to refer to God's existence within the context of the story and is not meant to reflect on the real world at all)
So, the final question for all of us is: why do our characters act they way they do and why did we give them the flaws that they have? If you can answer these questions to your own satisfaction then you should have no problem.