All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A person who performs Hajj or 'Umrah is not obliged to perform forty prayers in Al-Haraam mosque in Makkah or in Madeenah, and there is no authentic narration, as far as we know, in this regard, and no scholar has ever stated that it is an obligation to do so. On the contrary, there is evidence in the Sunnah that the prayer of a woman in her own home was better than her praying behind the Prophet in the Prophet's mosque in Madeenah.
For more benefit, please refer to Fataawa 86597 and 92531.
Allaah Knows best.