Sin is passed on to the unborn child but there is a truth in scripture for how Christ can bring the unborn that has died in the womb to God.All births are "perfect" and Sinless - until the person themselves invariably begins to SIN, and fall short. Humans have a HUMAN nature, just like Adam, me and Jesus. Since our first born died (came too early/hyaline membrane) I 'spect to meet her on the other side as she really is.
Psalm 51:5 Behold, I was shapen in iniquity; and in sin did my mother conceive me.
6 Behold, thou desirest truth in the inward parts: and in the hidden part thou shalt make me to know wisdom.
Psalm 139:13 For thou hast possessed my reins: thou hast covered me in my mother's womb.
14 I will praise thee; for I am fearfully and wonderfully made: marvellous are thy works; and that my soul knoweth right well.
15 My substance was not hid from thee, when I was made in secret, and curiously wrought in the lowest parts of the earth.
16 Thine eyes did see my substance, yet being unperfect; and in thy book all my members were written, which in continuance were fashioned, when as yet there was none of them.
17 How precious also are thy thoughts unto me, O God! how great is the sum of them!
Matthew 11:25 At that time Jesus answered and said, I thank thee, O Father, Lord of heaven and earth, because thou hast hid these things from the wise and prudent, and hast revealed them unto babes.
26 Even so, Father: for so it seemed good in thy sight.
27 All things are delivered unto me of my Father: and no man knoweth the Son, but the Father; neither knoweth any man the Father, save the Son, and he to whomsoever the Son will reveal him.
I suspect that the Father can reveal His Son to the unborn to reveal His Son to them as He enables them to believe in Him to be saved because...
Psalm 58:3 The wicked are estranged from the womb: they go astray as soon as they be born, speaking lies.
1 Corinthians 15:21 For since by man came death, by man came also the resurrection of the dead.
22 For as in Adam all die, even so in Christ shall all be made alive.
The baby, unborn or born, dies because it had inherited sin, but the starting scripture above proves that necessity for Christ to save the unborn child that would have believed in Him to be saved if born & raised and He will.
Paul also writes this about being married to a believer being married to an unbeliever...
1 Corinthians 7:12 But to the rest speak I, not the Lord: If any brother hath a wife that believeth not, and she be pleased to dwell with him, let him not put her away.
13 And the woman which hath an husband that believeth not, and if he be pleased to dwell with her, let her not leave him.
14 For the unbelieving husband is sanctified by the wife, and the unbelieving wife is sanctified by the husband: else were your children unclean; but now are they holy.
15 But if the unbelieving depart, let him depart. A brother or a sister is not under bondage in such cases: but God hath called us to peace.
16 For what knowest thou, O wife, whether thou shalt save thy husband? or how knowest thou, O man, whether thou shalt save thy wife?
17 But as God hath distributed to every man, as the Lord hath called every one, so let him walk. And so ordain I in all churches.
So you are right since I assume your wife is also a believer but even if not, she is sanctified by your marriage to her and thus your unborn child is holy when the child had died.
But obviously Christ is the only One that can bring us, including the unborn child, to God.
1 Peter 3:18 For Christ also hath once suffered for sins, the just for the unjust, that he might bring us to God, being put to death in the flesh, but quickened by the Spirit:
So you will be seeing your unborn child in Heaven in that day.