It was 500 years ago when the massive star system had collapsed in its final death throes and randomly threw out enormous jets of radiation into the vacuum of space.
Traveling at the speed of light, Earth would have no warning of the shower of radiation that would decimate half the planet's life forms and atmosphere.
I think there is either a Twilight Zone or Outer Limits episode about this.
In real life there are no sources nearby enough to pose any risk within the foreseeable future. Stars take a long time to die. Way before anything that happens that could be dangerous to Earth, there will be a show to be seen and being close it will have been a point of interest.
There is a non zero chance there is something a long way away that somehow throws off a very focused beam directly on the Earth. But that chance is so small it's on par with something like grey goo or you being a Boltzmann brain. Interesting in theory, but not really something that happens.
Very true, you never know what we may find. But as to finding something that actually threatens Earth, I really don't think so, but it makes for excellent sci-fi storytelling!