This wording is unrestricted; ʿAlī’s ḥadīth places a qualification upon it. Ibn Ḥazm hinted at precisely this when he previously said, “This is an additional, trustworthy detail that may not be set aside.”
Al-Bayhaqī then remarked, “A report from ʿAlī contradicts this, and another supports it.” He and al-Ḍiyāʾ, in al-Mukhtārah (1/185), thereupon cited—through the chain of Sufyān, who said, “Abū Isḥāq informed me from ʿĀṣim ibn Ḍumrah, from ʿAlī”—that ʿAlī said: “The Messenger of Allah ﷺ used to pray two rakʿahs (units of prayer) after every obligatory prayer except Fajr and ʿAṣr.”
I say: this in no way contradicts the first ḥadīth, for it merely negates that the Prophet ﷺ performed two rakʿahs after the ʿAṣr prayer, whereas the first ḥadīth never affirmed such a practice in the first place so as to be set against it. At most, it shows the permissibility of praying after ʿAṣr until just before the sun begins to yellow, and it is obvious that the Prophet ﷺ was not required to do everything whose permissibility is established by legal evidence.
True, it is authentically reported from Umm Salamah and ʿĀʾishah that the Prophet ﷺ performed the two rakʿahs of the post-ẓuhr sunnah after the ʿAṣr prayer, and ʿĀʾishah related that he thereafter persisted in them. This appears to conflict with ʿAlī’s second report, yet reconciling them is easy: each narrator conveyed what he knew, and the one who knows is proof against the one who does not. It seems that ʿAlī later learned from certain Companions what he had earlier denied, for there is a narration from him affirming that the Prophet ﷺ did pray after ʿAṣr. Al-Bayhaqī alluded to this when he said, “As for the report that agrees with it, it is in what we were told…,” and then produced—through the route of Shuʿbah from Abū Isḥāq, from ʿĀṣim ibn Ḍumrah—who said: “We were with ʿAlī on a journey; he led us in the ʿAṣr prayer as two rakʿahs, then he entered …”