I work as a software engineer in an engineering company. Over the years colleagues came and went, and a few of the people I know well have left too. I am generally a curious person so when I heard that they are "pursuing a different opportunity", I asked the person (in person) where they were going next. Two out of three times this question seems to have shocked/stunned the person a bit, because they would pause and eventually reply.
Are you not supposed to ask this question? I don't see why it would be a secret because I'd find out on LinkedIn in a week or two anyways. Since I know it's not health reasons, I felt it was fair to ask. Again, I knew these people well (e.g. we talk about families, plans, vacations, etc together).