and because the Prophet ﷺ commanded it without restricting that command to the final tashahhud alone. Moreover, he himself performed it consistently and said, “Pray as you have seen me pray” (al-Bukhārī, 608). He also instructed Ibn Masʿūd, “When any one of you performs the prayer, let him say: ‘All greetings belong to Allah…,’” and so on.
By default, a prophetic command signifies obligation.
The Ḥanafīs therefore hold that sitting for both the first and second tashahhud is obligatory (wājib), and that omitting either of them requires the prostrations of forgetfulness.
Mālik, al-Shāfiʿī, and their followers, on the other hand, regard it as recommended rather than obligatory.
Their proof is that the Prophet ﷺ once omitted the tashahhuds unintentionally, did not return to sit for them, and did not rebuke the Companions when they likewise left them out.
The reply is that one must return to the tashahhud only if he realizes the omission before he has fully risen to standing; in that case he should sit and then perform the two prostrations of forgetfulness. Abū Dāwūd (1036) records from al-Mughīrah ibn Shuʿbah that the Prophet ﷺ said, “If one of you rises after two rakʿahs and has not yet stood upright, let him sit down and perform the two prostrations of forgetfulness.”
Although the chain of this report contains Jābir al-Juʿfī, who was a Shīʿī, the ḥadith itself has no sectarian content. Even though the narration is weakened by this man—Abū Dāwūd transmitted from him only on this single occasion—it is nonetheless supported by other evidences. Allah knows best.