It’s a little off. Joseph did not doubt and he didn’t try to come up with a story. He was visited by an angel.
He was already betrothed and for that time and culture, he and Mary were already married but were waiting for a prescribed period before moving in together. They were not planning on sexual relations though. In that time and culture, a woman could not live on her own. It is presumed though not known that Mary’s father must have been dying or dead and that Mary did not have any brothers or close male kin to take her in, and thus she would have been married to give her a male protector.
Thus, she was betrothed to Joseph.
When Mary told Joseph of the Annunciation, he decided, as a righteous man, to not live with her (while some Scriptures say ‘divorce’ that is mostly a translation issue). Many theologians state that Joseph, believing himself to be unworthy to care for Mary as the Mother of God —comparing himself to someone unworthy to touch the Ark of the Covenant—did not want to presume such an important role as the consort of the Mother of the Lord. And they point out that divorcing Mary or doubting her would not be a righteous act at all —throwing Mary out to fend for herself—but that Scripture had just CALLED Joseph RIGHTEOUS. But it WOULD be a righteous act to humble oneself if one was offered a fantastic thing —imagine, being privileged to care for the Mother of God! To be the human foster father of GOD! A righteous person would say, “Lord I am not worthy” and THAT is what it is believed that Joseph did. And that is why it makes sense that the angel said, “Joseph do not FEAR to take Mary into your home.” The angel didn’t say, “Joseph, you are wrong, Mary is a good girl, how dare you try to say otherwise, now take her in”. The angel said, “Joseph, do not FEAR, meaning, Joseph, God has found you worthy to be the husband of this woman on earth and to care for her and the Holy Child. Do not fear’.