This is eerily similar to the plot of The Three-Body Problem[1], specifically the cyclical development of intelligent life and its race to avoid mass extinction caused by intersecting one of three suns in its stellar system.
[1]https://en.wikipedia.org/wiki/The_Three-Body_Problem