Did Ahaziah die after fleeing or after capture by Jehu?
Kings ends Ahaziah's flight with his death at Megiddo. Chronicles ends his capture with delivery to Jehu and execution. The accounts differ over the sequence of his final movements.
Awaiting assessment
This comparison has not yet been assessed for the inference it requires or its importance.
Kings describes flight to Megiddo and death there
But when Ahaziah the king of Judah saw this, he fled by the way of the garden house. And Jehu followed after him, and said, Smite him also in the chariot. And they did so at the going up to Gur, which is by Ibleam. And he fled to Megiddo, and died there. And his servants carried him in a chariot to Jerusalem, and buried him in his sepulchre with his fathers in the city of David.
Chronicles describes capture, delivery to Jehu, and execution
And it came to pass, that, when Jehu was executing judgment upon the house of Ahab, and found the princes of Judah, and the sons of the brethren of Ahaziah, that ministered to Ahaziah, he slew them. And he sought Ahaziah: and they caught him, (for he was hid in Samaria,) and brought him to Jehu: and when they had slain him, they buried him: Because, said they, he is the son of Jehoshaphat, who sought the Lord with all his heart. So the house of Ahaziah had no power to keep still the kingdom.
Understanding the contradiction
In 2 Kings 9:27, Ahaziah flees from Jehu, who orders him struck in his chariot near Ibleam. Ahaziah flees to Megiddo and dies there. In 2 Chronicles 22:9, Jehu's men find him hiding in Samaria, capture him, bring him to Jehu, and kill him. These are different accounts of his final movements and circumstances of death.
A combined account must insert the Samaria capture before the pursuit, or between the wounding and death at Megiddo. That requires an additional transfer, escape, or reordered sequence. Chronicles does not name the execution site, so its text does not explicitly say Ahaziah died in Samaria. The problem is how its capture and execution sequence fits Kings' pursuit and death, rather than two explicitly named death cities.
The KJV's 'And they did so' supplies wording after Jehu's command that is not expressed in the surviving Hebrew clause. Translations that supply a shooting make the compressed action easier to follow, but that supplied detail cannot settle the sequence. The explicit flight to Megiddo and death there remain.
Related comparisons: Who buried Ahaziah?