Contradiction with 1 Kings 15:5
1 Kings 15:5 states that David did what was right in the eyes of the Lord and did not deviate except in the case of Uriah, which contrasts with 2 Kings 22:2, where Josiah's conduct is portrayed without mentioning any exceptions.
1 Kings 15:5: Because David did [that which was] right in the eyes of the LORD, and turned not aside from any [thing] that he commanded him all the days of his life, save only in the matter of Uriah the Hittite.
Contradiction with Exodus 34:7
Exodus 34:7 speaks of God not clearing the guilty and visiting iniquity, while 2 Kings 22:2 portrays Josiah as doing what was right, implying divine favor without the mention of punishment.
Exodus 34:7: Keeping mercy for thousands, forgiving iniquity and transgression and sin, and that will by no means clear [the guilty]; visiting the iniquity of the fathers upon the children, and upon the children's children, unto the third and to the fourth [generation].
Contradiction with Romans 3:23
Romans 3:23 states that all have sinned and fall short of the glory of God, which contrasts with 2 Kings 22:2, where Josiah is presented as having walked perfectly in the eyes of the Lord.
Romans 3:23: For all have sinned, and come short of the glory of God;