A magnetar quake 500 light years away would sterilize the planet (but not harm the magnetar at all). Fortunately, the nearest magnetar we know about is 9000 light years away, so its blast would be ~300 times weaker, just enough for a garden-variety mass extinction, and end of civilization. But there might be one closer.
All the ones we detect happen millions of times farther away. So they are only terrifying if you think about how we can even tell something happened that far away.
Is it unlikely that we are far enough to be mostly safe from these threats?
Or maybe it's one filter for Fermi paradox (on a planet that isn't far from these kinds of threats life wouldn't survive long enough to develop civilization).
The Fermi paradox needs another filter. Some people think it is that interstellar civilizations that arise come into contact with one another, destroying both.