Praise be to Allaah.
This prostration, as the imaam of the mosque said, has no basis (in Islam). Yes, there is sujood al-shukr (prostration of thanksgiving) which is prescribed when a new blessing comes or something bad is warded off, but this is no longer applicable when such a long time has passed.
- Shaykh ‘Abd al-Kareem al-Khudayr.
If you had done the prostration of thanksgiving when your daughter was born safe and sound and her mother was fine, we would say that this is good, and is an action prescribed by Islam. But allocating a specific time of forty days, and saying that it has to be done in the mosque, is bid’ah. May Allaah help us and you to do all that is good.