If a prof goes into the university system, s/he can see who's signed up for a course ahead of time. This past semester, I looked, and saw that one of the really smart, really fun and challenging students had signed up for a course I was teaching. Then I looked just before classes actually started, and s/he wasn't signed up anymore. And I felt a little sorry, because this is a great student. But s/he didn't want to take my course, and I didn't know why. Was it because s/he'd found a better professor? Did s/he think my course is stupid sounding? These are the things that go through my mind.
The other day, the student stopped by my office, smiling, and said s/he'd wanted to come thank me for advising hir to aim hir studies in a different direction. Yes, s/he said, s/he'd started taking courses in this other area, and it was working out great, s/he was happier than ever before with hir education. S/he told me excitedly about some work s/he is doing with another prof. It sounds like really interesting, useful work.
I'm happy for the student, and glad I gave appropriate advice.
But still, I advised a student to basically go elsewhere academically, away from the field I love, away from my class, and I feel a little loss there, too.
I shouldn't feel sad about doing a good job, should I?