I would argue that not only does Jaime's fate respect the evolution of his character over the previous seasons of the show, but that his evolution is what makes that fate the right and necessary one.
He's been in this situation before, after all; Cersei's situation is a mirror image of the Mad King's before opening the gates to Tywin Lannister. There's a vastly superior force outside the gates, there's a mad monarch, the life of someone he loves is threatened. Maybe that callback is an accident, but I really, really doubt it. I think it's entirely on purpose, and I think awareness of it colors Jaime's in-character response. And he responds by trying to save lives, rather than trying to take them. It's a quixotic, hopeless, suicidal response, and that's kind of the point: the old Jaime, the Jaime we met at the start of the series, would never in a million years have responded that way.
Jaime's done some terrible things, and he knows it. If he stays at Winterfell and waits for news of the city to fall, he's going to have to live with the knowledge that on top of all those terrible things, he not only betrayed the king he'd sworn to protect (no matter how justified it might have been), but also failed the woman he loves in her hour of greatest need (no matter how undeserving of that love she might be). Old Jaime could have lived with that, but the new Jaime would be destroyed by it, and he knows it.
He doesn't go to King's Landing for Cersei, he goes for himself and his own conscience, and the fact that he even has a conscience is evidence of how different he really is now. He goes because he needs to be able to tell himself that everything he's been through taught him something, that he wasn't just a weak, vain man entirely defined by his family and his fighting skill and worthless without them; and that when he was put to the test, he did the best he could no matter what it cost him -- just as Brienne, the catalyst of his transformation, would have in his shoes. The irony in the woman who loves him being the one whose example he follows into death is pretty delicious.
It's a wonderfully tragic end, and I'd argue that he is, in the end, redeemed by it. It's not a happy ending, but it is exactly the kind of bittersweet ending George Martin would write for a character like this.