
In the scenario mentioned, if a person forgot to recite Duʿāʾ al-Qunūt in the third rakʿah of Witr prayer and thereafter stood up for a fourth rakʿah, then the ruling depends on whether they had sat for the duration of the tashahhud after the third rakʿah or not.
If the person had sat after the third rakʿah for the duration in which the tashahhud could be recited, and thereafter mistakenly stood for a fourth rakʿah, then the Witr prayer will remain valid, provided that Sajdah Sahw was performed at the end of the prayer.
However, if the person did not sit after the third rakʿah for the duration of the tashahhud and instead stood directly for the fourth rakʿah, then the Witr prayer will not be valid, and it will be necessary to repeat the prayer even if Sajdah Sahw was offered.
۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔۔
دلائل:
فتح القدير: (511/1، ط: دار الفكر)
(وَلَوْ قَعَدَ فِي الرَّابِعَةِ ثُمَّ قَامَ وَلَمْ يُسَلِّمْ عَادَ إلَى الْقَعْدَةِ مَا لَمْ يَسْجُدْ لِلْخَامِسَةِ وَسَلَّمَ) لِأَنَّ التَّسْلِيمَ فِي حَالَةِ الْقِيَامِ غَيْرُ مَشْرُوعٍ، وَأَمْكَنَهُ الْإِقَامَةُ عَلَى وَجْهِهِ بِالْقُعُودِ لِأَنَّ مَا دُونَ الرَّكْعَةِ بِمَحَلِّ الرَّفْضِ.
(وَإِنْ قَيَّدَ الْخَامِسَةَ بِالسَّجْدَةِ ثُمَّ تَذَكَّرَ ضَمَّ إلَيْهَا رَكْعَةً أُخْرَى وَتَمَّ فَرْضُهُ) لِأَنَّ الْبَاقِيَ إصَابَةُ لَفْظَةِ السَّلَامِ وَهِيَ وَاجِبَةٌ، وَإِنَّمَا يَضُمُّ إلَيْهَا أُخْرَى لِتَصِيرَ الرَّكْعَتَانِ نَفْلًا لِأَنَّ الرَّكْعَةَ الْوَاحِدَةَ لَا تُجْزِئُهُ «لِنَهْيِهِ عليه السلام عَنْ الْبَتْرَاءِ»، ثُمَّ لَا تَنُوبَانِ عَنْ سُنَّةِ.
الفتاوى الهندية: (1/129، ط: دار الفكر)
وَإِنْ لَمْ يَقْعُدْ عَلَى رَأْسِ الرَّابِعَةِ حَتَّى قَامَ إلَى الْخَامِسَةِ إنْ تَذَكَّرَ قَبْلَ أَنْ يُقَيِّدَ الْخَامِسَةَ بِالسَّجْدَةِ عَادَ إلَى الْقَعْدَةِ، هَكَذَا فِي الْمُحِيطِ، وَفِي الْخُلَاصَةِ وَيَتَشَهَّدُ وَيُسَلِّمُ وَيَسْجُدُ لِلسَّهْوِ، كَذَا فِي التَّتَارْخَانِيَّة، وَإِنْ قَيَّدَ الْخَامِسَةَ بِالسَّجْدَةِ فَسَدَ ظُهْرُهُ عِنْدَنَا، كَذَا فِي الْمُحِيطِ.
Allah the Almighty knows best.
Darul ifta Al-Ikhlas, Karachi.