Can one go out of the mosque (after the Adhan, or the Iqama) if there is a genuine excuse?
باب هَلْ يَخْرُجُ مِنَ الْمَسْجِدِ لِعِلَّةٍ
Sahih al-Bukhari, Book of Call to Prayers (Adhaan)(view book)
Sahih al-Bukhari 639
Narrated Abu Huraira:
Allah's Apostle went out (of the mosque) when the Iqama had been pronounced and the rows straightened. The Prophet stood at his Musalla (praying place) and we waited for the Prophet to begin the prayer with Takbir. He left and asked us to remain in our places. We kept on standing till the Prophet returned and the water was trickling from his head for he had taken a bath (of Janaba).
حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ عَبْدِ اللَّهِ، قَالَ حَدَّثَنَا إِبْرَاهِيمُ بْنُ سَعْدٍ، عَنْ صَالِحِ بْنِ كَيْسَانَ، عَنِ ابْنِ شِهَابٍ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ ﷺ خَرَجَ وَقَدْ أُقِيمَتِ الصَّلاَةُ وَعُدِّلَتِ الصُّفُوفُ، حَتَّى إِذَا قَامَ فِي مُصَلاَّهُ انْتَظَرْنَا أَنْ يُكَبِّرَ انْصَرَفَ قَالَ " عَلَى مَكَانِكُمْ ". فَمَكَثْنَا عَلَى هَيْئَتِنَا حَتَّى خَرَجَ إِلَيْنَا يَنْطُفُ رَأْسُهُ مَاءً وَقَدِ اغْتَسَلَ.