Where does the concept of Hashana rabah being compared to Yom Kippur come from? Especially within the Sephardic and Hasidic communities. I've heard that Hashanah rabah is alluded to in Kabbalah as like the second "Yom Kippur" meaning teshuva from simcha and not yirah. I'm just wondering if there are gemarot that allude to it in the same manner as I've heard that Kabbalah does?
See in Shulchan Aruch Orach Chayim 664, I will try to quote statements in SA, RMA and commentaries which contain comparison to Yom Kippur or to the judgment for the year.
Sayif 1 in RMA.
כתבו הראשונים ז"ל, שיש סימן בצל הלבנה בליל הושענא רבה מה שיקרה לו או לקרוביו באותה השנה.
Some Rishonim wrote that there is a sign at the shade of the moon, which shows what will happen to him and his family this year.
ומרבים קצת בנרות כמו ביום הכיפורים לפי שבחג נידונים על המים.
We increase the number of csndkes as for Yom Kippur since during th festival we are judged concerning water.
הגה: והמדקדקים נוהגים לטבול עצמן קודם עלות השחר כמו בערב יום כיפור (מנהגים). ויש נוהגים ללבוש הקיטל כמו ביום כיפור:
Consciencious people have the custom to immerse themselves in mikveh before the sunrise as we make before Yom Kippur. Some people are accustomed to dress in kittel as at Yom Kippur.
לפי שבחג נידונין על המים, והוא גמר החתימה
The Shulchan Aruch said that during the festival we are judged for water and Hosha'na rabba (which is the last day) would seal the decision.
לפי שבחג נידונין על המים וכל חיי האדם תלויין במים, והכל הולך אחר החיתום:
RMA said "as at Yom Kippur", Since at festival we are judged concerning water, and human life does depend on water, all depends on this sealing.
The last statement, quoted from Mishna Berura seems to be an important contribution to understanding.
Poskim don't quote Gemarot but used the Mishna which says that on 4 times the world is judged, at Chag (Sukkoth) for water.
At the times of Bet Hamikdash, the mishna explains that they made seven laps around the mizbeach with willow branches.
Thanks to Wikipedia I found a text in Ben Ish Chay zot habracha shana 1. But I don't included it in the answer because you look at Gemarot.
The Yerushalmi Rosh HaShana (4:8) states:
ואותי יום יום ידרושון זו תקיעה וערבה
'They seek Me out day by day' (Isaiah 58:2) this refers to the shofar blast [Rosh HaShana] and the willow [Hoshana Rabba].
While not a proof, this certainly could be interpreted as suggesting a link between the high holidays, and Hoshana Rabba, and this is the closest that any Talmudic passage comes to doing so.
Rabbi Sh'muel Jaffe Ashkenazi (16th cent.) explains in Yefeh Mareh, his commentary to the Yerushalmi, that Hoshana Rabba is the day of seeking out God, since the divine judgement is finally sealed on that day.
However it should be noted that this reading is probably influenced by Kabbalistic sources that imply this. [a]
A similar slant is placed on the statement of the Mishna (Rosh HaShana 1:2) that the judgement regarding water takes place on Succot. Cf.Tur OH 664.
While not a Gemara, it is important to note that Hoshana Rabba was known as a day like Yom Kippur even before kabbalistic literature (most notably the Zohar) popularised this. Significantly, the Manhig (Hilkhot Sukkah pp. 203-4) makes this description as noted by R. Eliezer Brodt here:
כי בהושענ' רבה מקויימת חתימת ג' הספרי' הפתוחי' לפני הקדוש ברוך הוא ונחתמי' ביום הכיפורי', ובהושענ' רבה תכלית הכפרה
On Hoshana Rabba are the three books which are open before God and are sealed on Yom Kippur are finally sealed. And on Hoshana Rabba is the final atonement.
[a] Cf. Zohar Tzav (31:2), Zohar Vayehi (220:1), Shibbolei Haleket (371), Manhig (etrog: 38), Orehot Hayyim (T'fillat HaMoadim 16), and the Talmudic Encyclopedia vol. VIII: Hoshana Rabba.