sheepy_dogs_handOmbrackYou can set a character in a given frame, and then make them evolve because of the things they have been through. I wasnt too surprised that Sansa became who she is now, because honestly who would stay the same after enduring so much shit.
Sansa had to deal with so much unfair events throughout the show, it's pretty fair for her to "give back" at some point. She's not the naive little maiden that she used to be, she toughen up, and seeks revenge, not justice.
Maybe with Sansa. Still doesn't apply for Jamie raping his sister, Littlefinger, Varys and Tyrion being idiots.
At that moment in the story, Jaime is back to King's Landing, after spending months in chains, in the mud, far from the life he had and the woman he loved. And when he's back, after fighting through dishonor and literal shit, he's only met with hatred, disregard and physical rejection (not to mention his first son just died). As he's trying to atone for his past acts, he now sees the foul side of Cersei, so as much as he loves her, he probably doesnt have as much respect/consideration for her as he used to have, and he too wants to get what he wants.
So again, this particular moment doesn't clash with the rest of his character, you just have to consider the characters aren't as one-dimensional as you seem to believe.