6 year old makes joke about death

My 6 year old said to me “hey mom want to hear a funny joke, why did the baby cross the road, to get hit and die” I immediately said that isn’t funny why would you say that and he started bawling and when I finally got it out of him he said he was upset about me talking about my grandma dying a few years ago and that he was scared and didn’t like when I talked about it and he scared of something happening to someone else? We’ve been talking about it because his great grandpa just found out he has cancer but we’ve been quite around him so I’m wondering if he over heard us? What should I do or how should I go about this? Should I worry that he said that?