Some example below:
איבעיא להו שמש שאינו קבוע בדמשחא מהו אמר רב הלכה ואין מורין כן
A dilemma was raised before the Sages: What is the ruling with regard to a servant who is not regularly employed in terms of examining cups and dishes by the light of an oil lamp? Is he permitted to examine the cups by candlelight, or not? From the perspective of his being a servant not regularly employed, it should be permitted. On the other hand, because it is an oil lamp it should be prohibited. Rav said: The halakha is that it is permitted, and, however, ab initio a public ruling is not issued to that effect so that they will not come to sin.
ואמר אביי הוה קאימנא קמיה דמר והוה קא מעבר סכינא אשפתא דרחיא ואמרי ליה לחדדה קא בעי מר או להעביר שמנוניתה ואמר לי להעביר שמנוניתה וחזיתי לדעתיה דלחדדה קא עביד וקסבר הלכה ואין מורין כן
Similarly, Abaye said: I was standing before my Master and teacher, Rabba, and he was running a knife over the edge of a millstone on a Festival. And I said to him: Does the Master wish to sharpen it, or is he doing this in order to remove its fat? And he said to me: To remove its fat. And I perceived his intention, that he did so in order to sharpen it, but he holds: This is the halakha, but a public ruling is not issued to that effect.