Here is a similar story (from Shabbos 10b) based on the explanation of the Chasam Sofer:
רַב חִסְדָּא הֲוָה נָקֵיט בִּידֵיהּ תַּרְתֵּי מַתְּנָתָא דְתוֹרָא, אָמַר: כׇּל מַאן דְּאָתֵי וְאָמַר לִי שְׁמַעְתָּתָא חַדְתָּא מִשְּׁמֵיהּ דְּרַב יָהֵיבְנָא לֵיהּ נִיהֲלֵיהּ. אֲמַר לֵיהּ רָבָא בַּר מַחְסֵיָא, הָכִי אָמַר רַב: הַנּוֹתֵן מַתָּנָה לַחֲבֵירוֹ צָרִיךְ לְהוֹדִיעוֹ. שֶׁנֶּאֱמַר: ״לָדַעַת כִּי אֲנִי ה׳ מְקַדִּשְׁכֶם״. יַהֲבַהּ נִיהֲלֵיהּ. אֲמַר חֲבִיבִין עֲלָךְ שְׁמַעְתָּתָא דְּרַב כּוּלֵּי הַאי? אֲמַר לֵיהּ: אִין. אֲמַר לֵיהּ: הַיְינוּ דְּאָמַר רַב: מֵילָתָא אַלָּבֵישַׁיְיהוּ יַקִּירָא. אֲמַר לֵיהּ: אֲמַר רַב הָכִי?! בָּתְרָיְיתָא עֲדִיפָא לִי מִקַּמָּיְיתָא, וְאִי הֲוָה נָקֵיטְנָא אַחֲרִיתִי, יָהֵיבְנָא לָךְ.
The Gemara relates that Rav Ḥisda would take in his hand two gifts of the priesthood separated from an ox. He said: Anyone who comes and tells me a new halakha in the name of Rav, I will give these gifts to him. Rava bar Meḥasseya said to him, Rav said as follows: One who gives a gift to his friend needs to inform him, as it stated: “To know that I am God Who sanctifies you.” He gave the gift to Rava bar Meḥasseya. Rava bar Meḥasseya said to Rav Ḥisda: Are the halakhot of Rav so beloved to you? Rav Ḥisda said to him: Yes. Rava bar Meḥasseya said to him, this is what Rav said: Fine wool is precious to those who wear it (Rav Ya’akov Emden), meaning only a person who is used to delicate items can appreciate their quality. Rav Ḥisda said to him excitedly: Did Rav say that? The latter statement is preferable to me more than the first. And if I were holding another gift I would give it to you.
The Chasam Sofer explains, that the reason why Rava specifically chose this teaching, is because Rava assumed that Rav Chisda wished to give away the meat as a gift - regardless if he was told a new teaching - and was just using that as an excuse to give it away
Therefore, Rava knew that Rav Chisda could not have known of this teaching, because had he known, he would not have concealed the fact that he wished to give him a gift, being that according to this teaching, if one wishes to give his friend a gift, he should inform him of it