The Constellation was destroyed in the Rigel system, Kandari sector, Alpha Quadrant. Specifically in a nearby star system called L-374. So depending on the vector (and assuming the weapon was coming from the edge of the galaxy closest to us) it would not have traveled a great distance into our galaxy. Or perhaps it only destroyed things directly in its path. I can see a lot of stars from the edge of the galaxy before it reached Sol...
The Rigel system was an inhabited planetary system consisting of at least twelve planets around its primary Rigel. An asteroid field was located 2 days away at impulse speed from Rigel XII. (TOS: "Mudd's Women", "The Doomsday Machine"; ENT: "Broken Bow")
The Rigel system was the first star system visited by the Enterprise NX-01, the first Earth starship with the warp 5 engine, after it departed from the Sol system. The Rigel colony on Rigel X was a popular trade complex at the time, visited by numerous species. (ENT: "Broken Bow")
In the mid-23rd century, the Rigel system was part of the most densely populated section of the Milky Way Galaxy. (TOS: "The Doomsday Machine")