a rainbow baby is a name for a healthy baby born after losing a baby due to miscarriage, infant loss, etc. the name "rainbow baby" comes from the idea of a rainbow appearing in the sky after a storm, or after a dark & turbulent time.

-healthline.com