Had Messenger of Allah ﷺ known what the women were doing, he would have forbidden them from going to the mosque as the women of Bani Israel had been forbidden. Yahya bin Saʿid (a sub-narrator) asked ʿAmra (another sub-narrator), "Were the women of Bani Israel forbidden?" She replied "Yes."
لَوْ أَدْرَكَ رَسُولُ اللَّهِ ﷺ مَا أَحْدَثَ النِّسَاءُ لَمَنَعَهُنَّ كَمَا مُنِعَتْ نِسَاءُ بَنِي إِسْرَائِيلَ قُلْتُ لِعَمْرَةَ أَوَ مُنِعْنَ قَالَتْ نَعَمْ