Dont give up, even though it can be difficult to think this way.
I have a theory that the soul and life can enter and exit. And as you will try to get pregnant again, the same soul and life that almost came with this pregnancy- will be the same as in the previous, only that the conditions not was right this time. for one reason or another.
This can maybe be comforting words for your wife.
Strength be with you.
Thank you for the kind words.