We read at Luke 2: 22-23:
When the time came for their purification according to the law of Moses, they brought him up to Jerusalem to present him to the Lord (as it is written in the law of the Lord, “Every firstborn male shall be designated as holy to the Lord”) .
Though the cross-references cited in RSVCE are Leviticus 12: 2-8 and Exodus 13: 2& 12, the said references mention purification after the birth of both sons and daughters. It is not clear how and when the exclusiveness of the male child took shape. Insertion of the quote from the OT in parentheses also calls for some elucidation.
My question is: was the narrative of Luke, specifically the reference to the OT, on the dedication of Jesus at the Temple, based on tradition rather than on the exact texts of the OT? What do the teachings of the Catholic Church tell about such a prospect?