Short answer
No. Tears and sorrow are not a failure of faith. When Ibrahim, the baby son of the Prophet (ﷺ), was dying, the Prophet (ﷺ) wept. One of his companions was surprised, and the Prophet (ﷺ) said this was mercy. He said the eyes shed tears and the heart grieves, but we say only what pleases our Lord. The prophet Jacob grieved for his son Joseph for years, until his eyes turned white with sorrow. Yet he brought his grief to God (﷾) alone, and he told his sons never to lose hope in God's (﷾) mercy. What Islam forbids is not grief. It is wailing, striking the face, tearing clothes, and words of anger against God (﷾). A believer may weep and bring his pain to God (﷾). He does not turn away from Him.
Full explanation
The Prophet (ﷺ) wept for his son
The Prophet (ﷺ) held his infant son Ibrahim as he was dying, and his eyes filled with tears. Abd al-Rahman ibn Awf, one of his companions, asked whether even he would weep. The Prophet (ﷺ) called it mercy. Then he spoke the words that sum up the Islamic way of grief. The eye weeps and the heart grieves, but the tongue says only what pleases God (﷾). He also wept when a grandchild was dying, and said this is a mercy God (﷾) places in the hearts of His servants.
Anas reports that the Prophet's (ﷺ) infant son Ibrahim was in his last breaths, and the Prophet's eyes filled with tears. Abd al-Rahman ibn Awf asked in surprise whether even he wept. He answered that this was mercy. Then he wept more and said that the eyes shed tears and the heart grieves, but we say only what pleases our Lord, and that they were saddened by Ibrahim's parting.
Usama ibn Zayd reports that the Prophet's (ﷺ) daughter sent for him as her child was dying. He first sent word that what Allah takes and what He gives belong to Him, that everything has its fixed term, and that she should be patient and hope for reward. When the child was brought to him, struggling for breath, his eyes flowed with tears. Asked what this was, he said it is a mercy Allah has placed in the hearts of His servants, and Allah is merciful to those of His servants who are merciful.
Jacob's grief for Joseph
The Qur'an tells of the prophet Jacob, who lost his son Joseph for many years. He grieved so deeply that his eyes turned white with sorrow. Yet he said he complained of his grief and sorrow only to God (﷾). He told his sons never to despair of God's (﷾) mercy, because only those without faith despair of it. A prophet's grief is recorded in scripture as part of his faith, not as a lapse from it.
“And he turned away from them, and said: "How great is my grief for Joseph!" And his eyes became white with sorrow, and he fell into silent melancholy.”
“He said: "I only complain of my distraction and anguish to Allah, and I know from Allah that which ye know not”
“"O my sons! go ye and enquire about Joseph and his brother, and never give up hope of Allah's Soothing Mercy: truly no one despairs of Allah's Soothing Mercy, except those who have no faith."”
Where the line is drawn
The Prophet (ﷺ) wept at the bedside of a sick companion. He explained that God (﷾) does not punish for the tears of the eye or the sadness of the heart. What is judged is what the tongue says. He also said that whoever slaps his cheeks, tears his clothes and cries out as people did before Islam is not one of us. So grief is allowed; despair and protest against God (﷾) are not.
Abdullah ibn Umar reports that the Prophet (ﷺ) visited Sa'd ibn Ubada in his illness and wept, and the people with him wept too. The Prophet said that Allah does not punish for the tears of the eye or the grief of the heart, but He punishes or shows mercy because of this, and he pointed to his tongue.
Abdullah ibn Mas'ud reports that the Prophet (ﷺ) said that whoever slaps his cheeks, tears his clothes and calls out with the cries of the time before Islam is not one of us.
What to say when loss comes
The Qur'an tells believers they will be tested with fear, hunger and the loss of wealth, lives and fruits. It gives good news to the patient who say, "To Allah we belong, and to Him is our return." The Prophet (ﷺ) taught a short prayer to add: "O Allah, reward me in my affliction and give me something better in its place." Umm Salama said it when her husband died, and she found it answered. She later became a wife of the Prophet (ﷺ).
“Be sure we shall test you with something of fear and hunger, some loss in goods or lives or the fruits (of your toil), but give glad tidings to those who patiently persevere, Who say, when afflicted with calamity: "To Allah We belong, and to Him is our return":- They are those on whom (Descend) blessings from Allah, and Mercy, and they are the ones that receive guidance.”
Umm Salama reports that the Prophet (ﷺ) taught: when a Muslim struck by a calamity says what Allah commanded, "To Allah we belong and to Him we return; O Allah, reward me in my affliction and give me something better in its place", Allah gives him something better. When her husband Abu Salama died she wondered who could be better than him, but she said the words, and Allah gave her the Messenger of Allah in marriage.
No pain is wasted
The Prophet (ﷺ) said that for every sorrow, sadness or hurt that reaches a believer, God (﷾) wipes away some of his sins. Even the prick of a thorn counts. He said the believer's affair is all good. If he is given something, he thanks God (﷾). If he is struck by hardship, he is patient. Both are good for him. The Qur'an promises that with every difficulty there is relief.
Abu Sa'id al-Khudri and Abu Hurayra report that the Prophet (ﷺ) said no tiredness, illness, sorrow, sadness, hurt or distress reaches a Muslim, not even the prick of a thorn, without Allah wiping away some of his sins because of it.
Suhayb reports that the Prophet (ﷺ) said the affair of the believer is wonderful, for there is good for him in all of it, and this is so for no one but the believer: if something pleasing happens he gives thanks, and that is good for him; if hardship strikes he is patient, and that is good for him.
“So, verily, with every difficulty, there is relief: Verily, with every difficulty there is relief.”
Perspectives
The Islamic perspective
Grief is a mercy God (﷾) places in the heart, and the Prophet (ﷺ) himself wept. Patience does not mean feeling nothing. It means saying only what pleases God (﷾), bringing the complaint to Him, and never despairing of His mercy.
The Prophet (ﷺ) wept as his son Ibrahim died. He said the eye weeps and the heart grieves, but we say only what pleases our Lord.
The Prophet (ﷺ) wept at a dying child's side. He called his tears a mercy that God (﷾) places in the hearts of His servants.
The Qur'an records that Jacob grieved until his eyes turned white. He complained of his grief to God (﷾) alone.
The Prophet (ﷺ) taught that God (﷾) does not punish tears or a grieving heart, only what the tongue says.
Slapping the face, tearing clothes and the wailing cries of pre-Islamic mourning are forbidden.
Every hardship that reaches a Muslim wipes away some of his sins. The believer who is patient loses nothing by it.