Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:16429

[Machine] Al-Shafi'i, may Allah have mercy on him, did not mention whether the fetus was male or female when the Messenger of Allah ﷺ ruled on the case of the free woman who had a miscarriage. The fetus, however, refers to the unborn baby, and whether it was male or female, it does not affect the ruling. This is how the fetus of the ummah is mentioned. Abu Sa'id narrated to us through Abu al-Abbas, who narrated from Rabi'ah, who stated that al-Shafi'i, may Allah have mercy on him, mentioned it.  

البيهقي:١٦٤٢٩قَالَ

الشَّافِعِيُّ رَحِمَهُ اللهُ وَلَمَّا قَضَى رَسُولُ اللهِ ﷺ فِي جَنِينِ الْحُرَّةِ بِغُرَّةٍ وَلَمْ يُذْكَرْ عَنْهُ أَنَّهُ سَأَلَ عَنِ الْجَنِينِ أَذَكَرٌ هُوَ أَو أُنْثَى؟ وَكَانَ الْجَنِينُ هُوَ الْحَمْلَ فَمَا كَانَ الْحَمْلُ وَاحِدًا فَسَوَاءٌ كَانَ ذَكَرًا أَوْ أُنْثَى يَعْنِي فَهَكَذَا جَنِينُ الْأَمَةِ أَخْبَرَنَاهُ أَبُو سَعِيدٍ ثنا أَبُو الْعَبَّاسِ أنبأ الرَّبِيعُ قَالَ أنبأ الشَّافِعِيُّ رَحِمَهُ اللهُ فَذَكَرَهُ