"Thus saith the Lord, Write ye this man childless, a man that shall not prosper in his days: for no man of his seed shall prosper, sitting upon the throne of David, and ruling any more in Judah" (Jeremiah 22:30).
The divine judgment of the above Scripture was pronounced against Israel's King Coniah, grandson of good King Josiah and son of the wicked king Jehoiakim. With the exception of Josiah, all of Israel's kings for over 76 years had done "evil in the sight of the Lord" (II Kings 21:2,20; 23:32,37). Then, when Coniah (same as Jehoiachin) continued in the same evil course for the first three months of his reign, God's patience was exhausted, and He finally allowed Nebuchadnezzar to carry Coniah away captive to Babylon, where God then also said that none of Coniah's descendants would ever again occupy Israel's throne.
The problem is that God had promised David that "I will set up thy seed after thee, . . . and I will establish the throne of his kingdom for ever" (II Samuel 7:12-13). This promise was even repeated later: "For thus saith the Lord; David shall never want a man to sit upon the throne of the house of Israel" (Jeremiah 33:17). Furthermore, Coniah did become the ancestor of the legal father of Jesus (Matthew 1:11-16), who is Himself destined to occupy "the throne of His father David" and then "reign over the house of Jacob for ever" (Luke 1:32-33).
But Joseph was not the actual father of Jesus. He was simply "the husband of Mary, of whom was born Jesus," and he "knew her not till she had brought forth" her Son, Jesus, while she was still a virgin (Matthew 1:25). Both prophecies were thereby fulfilled, for Mary was also a descendant of David (Luke 1:23-31). God's Word was found true and consistent after all by the amazing miracle of Christ's miraculous conception and virgin birth! HMM