I found several ocurences in Hebrewbooks of books which related this sentence. Many ofcthem asked your question on Chatam Sofer. Some explanations to link the sentence to Parshat Haegel are found.
The older is the Chassid Yaavets, cited in Midrash Shmuel, I read that it can be found in the Chassid Yaavets on Avot itself. . Chassid Yaavets was in Gerush Portugal (according to Wikipedia born in 1440 and deceased in 1508) . Most books cited are Acharonim and they has only hypothesis. Nobody did find a midrash or sowmehat in the Jewish Chazalic Patrimony
midrash Shmuel Avot 3, 15
Here you can see some Rav who asked the same question and attempted to answer.
Here the author told that Rav Shmuel Elgazi also cited this sentence in name of Chazal.
Shut Bene Banim said that it is definitely from the Christian NT.
Midrash Hamelitsa Hayivrit has an hypothesis that the source is the Egel Hazahav which was greater than Aharon for the people. He also astonished by the Chatam Sofer.
Finally nobody did find it in a Maamar Chazal Mamash the older reference is the Yaavets. It's possible that a wise sentence would be foune in diverse cultures, Hillel said דשני לך אל תעביד לחברך and I heard a similar sentence in name of Confucius. Maybe that sentence of this kind are anterior to the books in which they are reported.