Surah Al-Ahzaab

33:38

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

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

Tafsir 33:38

There is no sin or oppression on the Prophet (peace be upon him) in his marriage to the wife of his adopted son which Allah made permissible for him. In fact, in doing so, he is following in the way of the Prophets before him; he is not any different to the messengers in that regard. The Prophet had no choice in the completion of this marriage and nullifying of adoption that Allah decreed; it was a decree which was to pass, there was no one who could overturn it.