מתה אשתו ונשא אשה אחרת — אינו רשאי ליכנס לביתו לדבר עמו ]תנחומין, [כדי שלא לפגוע באשה החדשה. If it was the mourner’s wife who died and he married another woman within thirty days of his first wife’s death, one may not enter his house to speak words of consolation with him, [so as not to offend his new wife].
The Gemara teaches that one may not console someone in his first thirty days of mourning whose wife died and he remarried, so as not to offend his new wife. And yet:
[תנו רבנן [שנו חכמים]: כל שלשים יום [שלאחר כל אבל אסורים לנישואין. [ואם] מתה אשתו — אסור לישא אשה אחרת עד שיעברו עליו שלשה רגלים [מאז מותה.] ר' יהודה אומר: רגל ראשון ושני — אסור, שלישי — מותר. The Sages taught another baraita: During the entire thirty-day [period of mourning, it is prohibited] to marry. If one’s wife died, it is prohibited to marry another wife until three Festivals pass [since her death]. Rabbi Yehuda says: Until the first and second Festivals have passed, he is prohibited from marrying; before the third Festival, however, he is permitted to do so. [Steinzaltz in brackets, sefaria’s translation]
We learn in the B’raisa that one may not remarry for at least two regalim, which is at least a 50 days (if we go according to rabbi Yehuda, and his wife dies the day before Pesach), or over a month! So how does the first case even make sense, that he remarried within 30 days?