I saw Abu Rafi, the freed slave of the Messenger of Allah ﷺ, notice Hasan bin Ali praying with his hair tied up in a knot. He either untied it himself or told him not to do that, saying, "The Messenger of Allah ﷺ forbade a man from praying with his hair knotted up."
حدثنا بكر بن خلف حدثنا خالد بن الحارث عن شعبة ح و حدثنا محمد بن بشار حدثنا محمد بن جعفر حدثنا شعبة أخبرني مخول بن راشد قال سمعت
رأيت أبا رافع مولى رسول الله ﷺ رأى الحسن بن علي وهو يصلي وقد عقص شعره فأطلقه أو نهى عنه وقال نهى رسول الله ﷺ أن يصلي الرجل وهو عاقص شعره
[Hasan]. Ahmad narrated it (Atraf Musnad, 6/221) from Muhammad bin Jafar, from him. Abu Saad Madani, I did not find anyone who declared him trustworthy, and it has been said that he is Shurahbil bin Saad, h: 592, and it has a hasan corroborating narration in Abu Dawud, h: 646.