The Talmud (Kesubos 103b; see Avos Rebbi Nason 25:2) says:
מת מתוך השחוק סימן יפה לו מתוך הבכי סימן רע לו
If one dies from laughter it is a good omen for him, but it is a bad omen to die from weeping.
The Talmud (Avodah Zarah 17a) relates the incident of Rebbi Elazar Ben Durdiah, and seems to imply that it was a great thing that he wept himself to death.
אמר אין הדבר תלוי אלא בי הניח ראשו בין ברכיו וגעה בבכיה עד שיצתה נשמתו יצתה בת קול ואמרה ר"א בן דורדיא מזומן לחיי העולם הבא
Rebbi Eliezer Ben Durdiah exclaimed, “Repentance is truly dependent upon my own actions!” He then inserted his head between his legs and began to wail and weep until his very soul left its body. A heavenly voice (bas kol) then announced, “Rabbi Eliezer Ben Durdiah is to be taken to life in the World to Come”.
If I have followed the story right, it seems like the crying is part of his penitence, which results in “Rabbi Eliezer Ben Durdiah is to be taken to life in the World to Come”, which is seemingly a very good omen for him.
Indeed, Tosafos (Kesubos ad loc.) notes how the phrase ‘one is to be taken to life in the World to Come’ always indicates that it is done so without a judgement and without suffering.
מזומן לחיי העולם הבא - תימה והלא כל ישראל יש להם חלק לעוה"ב ופירש הרב ר' מאיר כל היכא דאמר מזומן לחיי העולם הבא היינו בלא דין ובלא יסורין:
Therefore, how is the statement that it is a bad omen to die from weeping to be explained in light of this tale. Does it apply only sometimes?