There was absolutely no motivation for Jaime to lie about killing the King. It was him, alone in the bath with Brienne. He sent away the guards. He wasn't in love with her or trying to get her in the sack. He wasn't trying to get her to let him escape. He wasn't performing for an audience. If Jaime wanted to make up this elaborate lie, he would have done it years ago. He would have told it to Ned Stark in Season 1 in their confrontation in the Throne Room. If he wanted to manipulate Brienne, he would have told her during their canoe trip or when they were tromping through the woods.
I simply cannot buy the very idea that Jaime would make up a massive lie to tell Brienne in the bathtub at Harrenhal. I mean, why? Does the Lion really care for the opinion of one lowly Sheep? Jaime will tell a well-placed lie to get what he wants, but he's more likely to tell a harsh truth and have people despise him. Didn't he answer a question about the last words of the first man he killed saying there were none, because he'd cut off the man's head? He was flip and snarky about it. The truth again being much worse than the lie.
When he killed the Targaryen King, he was ...17 I think? The King had set Ned Stark's brother and father on fire in that Throne Room. He was called the "Mad King" for a reason. The idea that he'd want to burn the whole city rather than surrender it doesn't really seem that outlandish. The King also had ordered him to decapitate his own father. The King was, by all accounts, a freaking nutjob.
The idea that Jaime would have been able to knock out the King, steal him away from the Pyromancer and the rest of the Kingsguard, hide him away until he saw reason, all while King's Landing is being sacked by Stark/Baratheon/Lannister forces is not reasonable. This also isn't a "modern" story where we expect police officers to only ever shoot criminals in the shoulder and not in the chest.
I can see perfectly how Jaime knew he would NEVER win the moment Ned Stark road his horse into the Throne Room. Ned Stark. The man who beheaded someone in front of his ten year old son, never even considering that the man might have had a valid reason for deserting the Night's Watch, you know, from seeing the undead rise. Nope, he just lopped off that guy's head because no matter what, deserting the Night's Watch results in death. There were no shades of gray in Ned Stark. Jaime knew it. Why try?