Dalil

Quran Al-Ahzab 33:38

مَّا كَانَ عَلَى ٱلنَّبِيِّ مِنۡ حَرَجٖ فِيمَا فَرَضَ ٱللَّهُ لَهُۥۖ سُنَّةَ ٱللَّهِ فِي ٱلَّذِينَ خَلَوۡاْ مِن قَبۡلُۚ وَكَانَ أَمۡرُ ٱللَّهِ قَدَرٗا مَّقۡدُورًا

Translation

There is not to be upon the Prophet any discomfort concerning that which Allāh has imposed upon him. [This is] the established way of Allāh with those [prophets] who have passed on before. And ever is the command of Allāh a destiny decreed.