Grief in the text, without a rebuke attached
The verses on Ya'qub, and then the Prophet, peace be upon him, at the death of his own son. He wept, and he named the grief out loud, and he said in the same breath that they would say only what pleases their Lord. Both at once.
Qur’an and Sunnah
وَتَوَلَّىٰ عَنۡهُمۡ وَقَالَ يَٰٓأَسَفَىٰ عَلَىٰ يُوسُفَ وَٱبۡيَضَّتۡ عَيۡنَاهُ مِنَ ٱلۡحُزۡنِ فَهُوَ كَظِيمࣱ
and he turned away from them, saying, ‘Alas for Joseph!’ His eyes went white with grief and he was filled with sorrow
Qur’an 12:84
قَالُواْ تَٱللَّهِ تَفۡتَؤُاْ تَذۡكُرُ يُوسُفَ حَتَّىٰ تَكُونَ حَرَضًا أَوۡ تَكُونَ مِنَ ٱلۡهَٰلِكِينَ
They said, ‘By God! You will ruin your health if you do not stop thinking of Joseph, or even die.’
Qur’an 12:85
قَالَ إِنَّمَآ أَشۡكُواْ بَثِّي وَحُزۡنِيٓ إِلَى ٱللَّهِ وَأَعۡلَمُ مِنَ ٱللَّهِ مَا لَا تَعۡلَمُونَ
He said, ‘I plead my grief and sorrow before God. I have knowledge from God that you do not have
Qur’an 12:86
Narrated Anas bin Malik:We went with Allah's Messenger (ﷺ) to the blacksmith Abu Saif, and he was the husband of the wet-nurse of Ibrahim (the son of the Prophet). Allah's Messenger (ﷺ) took Ibrahim and kissed him and smelled him and later we entered Abu Saif's house and at that time Ibrahim was in his last breaths, and the eyes of Allah's Messenger (ﷺ) started shedding tears. `Abdur Rahman bin `Auf said, "O Allah's Apostle, even you are weeping!" He said, "O Ibn `Auf, this is mercy." Then he wept more and said, "The eyes are shedding tears and the heart is grieved, and we will not say except what pleases our Lord, O Ibrahim ! Indeed we are grieved by your separation
Sahih al-Bukhari 1303graded sound, sahihaynfull report
Translation: M.A.S. Abdel Haleem, The Qur'an, Oxford University Press, 2004.