Josaphat (Matthew) = Jehoshapat (Kings, Chronicles)
Joram (Matthew) = Jehoram (Kings, Chronicles).
So far no problem; I knew these ones already. Now...
According to Matthew 1:
Josaphat, Joram, Ozias, Joatham, Achaz, Ezekias
According to 1 Chronicles 3:10-14
Jehoshaphat, Joram, Ahaziah, Joash, Amaziah, Azariah, Jotham, Ahaz, Hezekiah
According to Kings:
Jehoshaphat (1 Kings 22:50)
Jehoram (2 Kings 8:16)
Ahaziah (8:25)
Joash (11:2 and 21; 13:1; 14:1) aka Jehoash (11:21 and 12:1, 6, 7, 18)
Amaziah (14:1)
Azariah (15:1; 52 yrs) aka Uzziah (15:13 and 34), aka Uzzah (15:32)
Jotham (15:32)
Ahaz (16:1)
Hezekiah (18:1)
According to 2 Chronicles:
Jehoshaphat (17:1)
Jehoram (21:1)
Jehoahaz (21:17 and 25:23, 25) aka Ahaziah (22:1, 7, 8, 9, 10) aka Azariah (22:6)
Joash (22:11)
Amaziah (24:27)
Uzziah (26:1)
Jotham (26:23)
Ahaz (27:9)
Hezekiah (28:27)
So, while Ozias of Matthew is consistent with Azariah/Uzziah/Uzza of 2 Kings and Uzziah of 2 Chronicles, it still can't be the same person as Ahaziah/Azariah/Jehoahaz of 2 Chronicles because Uzziah is three generations later.
Further, there is an "Azariah son of Jehoram" listed in 2 Chronicles 23:1, allowing the possibility that the Azariah of 22:6 is not Ahaziah, as Ahaziah was slain in 22:9.
There still is only one Ahaziah, king of Judah. There is still a contradiction (actually, several) in the KJV.