The Gemara Rosh Hashanah 19b says:
והאמר רבי חיננא בר כהנא א"ר מימות עזרא ואילך לא מצינו אלול מעובר לא מצינו דלא איצטריך הא איצטריך מעברינן ליה
Didn’t Rabbi Chinana bar Kahana say that Rav said: From the days of Ezra and onward, we have never found that the month of Elul had an additional day. We have not found that the month of Elul ever had an additional day, because it was not necessary to add a day. But if it had been necessary, they would have added an additional day.
This question shows that the second half of the Gemara's statement qualifies the first half; there certainly have been Eluls with thirty days, but only when necessary.
According to this, however, how is the Gemara Rosh Hashana 32a to be understood?
ליום השני ירד רבי חנינא מאי שני אילימא יו"ט שני למימרא דעברוה לאלול והאמר רבי חנינא בר כהנא מימות עזרא ואילך לא מצינו אלול מעובר אמר רב חסדא מאי שני ליום שני לשנה הבאה:
The baraita taught that on the second day Rabbi Ḥanina descended as the prayer leader. The Gemara asks: What is the meaning of: The second day? If we say that this is referring to the second day of the Festival day of Rosh HaShana, is that to say that they rendered Elul a full month, so that the thirtieth day of Elul was the first day of Rosh HaShana and the first day of Tishrei was the second day? But didn’t Rabbi Ḥanina bar Kahana say: From the days of Ezra onward we have not found that the month of Elul was ever rendered full. Rav Ḥisda said: What is the meaning of: The second day? It means on the second day, the next time it was Rosh HaShana, i.e., on Rosh HaShana of the following year.
Why doesn't the Gemara simply answer that that year it was necessary to add a day to Elul, as the Gemara says on 19b? This Gemara on 32a seems to be taking Rav Chinana's statement literally, and there never were Eluls with thirty days. How can these Gemaras be reconciled?