In Berachot 33a (translations modified from Sefaria), Rav Ami and Rabbi El'azar say that words sandwiched between two instances of the name of God are great. Rav Acha Karchina'a challenges this, based on the fact that revenge is also mentioned between two of God's names.
מתקיף לה רב אחא קרחינאה אלא מעתה גדולה נקמה שנתנה בין שתי אותיות שנאמר אל נקמות ה׳
Rav Aḥa Karḥina’a strongly objects to this: However, if so, Great is revenge that was placed between two letters, as it is stated: “God of vengeance, Lord, God of vengeance shine forth” (Psalms 94:1).
His interlocutor (I assume Rav Ami) responds to the problem by saying that even though it can be bad, revenge is indeed a great thing in certain cases.
אמר ליה אין במילתה מיהא גדולה היא והיינו דאמר עולא שתי נקמות הללו למה אחת לטובה ואחת לרעה לטובה דכתיב הופיע מהר פארן לרעה דכתיב אל נקמות ה׳ אל נקמות הופיע
He said to him: Yes. At least in its place, it is great. That is that which Ulla said: Why are these two vengeances mentioned in a single verse? One for good and one for evil. Vengeance for good, as it is written: “He shined forth from Mount Paran” (Deuteronomy 33:2); vengeance for evil, as it is written: “God of vengeance, Lord, God of vengeance shine forth.”
To cite two examples where we are obligated to take revenge:
Numbers 31:2:
נְקֹ֗ם נִקְמַת֙ בְּנֵ֣י יִשְׂרָאֵ֔ל מֵאֵ֖ת הַמִּדְיָנִ֑ים אַחַ֖ר תֵּאָסֵ֥ף אֶל־עַמֶּֽיךָ׃
“Avenge the Israelite people on the Midianites; then you shall be gathered to your kin.”
Yoma 22b:
ואמר רבי יוחנן משום ר' שמעון בן יהוצדק כל תלמיד חכם שאינו נוקם ונוטר כנחש אינו תלמיד חכם
And Rabbi Yoḥanan said in the name of Rabbi Shimon ben Yehotzadak: Any Torah scholar who does not avenge himself and bear a grudge like a snake is not a Torah scholar.
So it's the third statement which is incorrect (or rather, only partially correct). We are usually prohibited from taking revenge, but also sometimes required to take revenge.