That opportunity is really weird like that.
I have likewise tested this (unlike when I had made the post that Seabody quoted). Your skill opportunity slot does not have to be empty. However, you do have to have a high relationship with at least one deceased person for a good while (the sims in question got the opportunity after being friends with the sim for about 3 weeks). You can't just make friends with someone, kill them off, and expect to get the opportunity. Likewise, several people in the active family can get the opportunity for the same deceased person. In the game that it happened, the first sim got the opportunity a few hours after the sim's death. The other sim got the opportunity about 8 days later.