Phalanx is the US CIWS based on the 20mm Vulcan gun. in other words, Phalanx is the “last line of defense machine guns” to which you are referring.
You may be thinking of Aegis, the integrated combat control system. We don’t yet know why the Gravely was unable to intercept the missile further out. Could have been human error, could have been a sea skimmer getting too close before being detected. To date, Aegis has been extremely effective against ballistic missiles and old cruise missiles. But given enough time an enemy can test your potential weak spots.
You may be thinking of Aegis, the integrated combat control system. We don’t yet know why the Gravely was unable to intercept the missile further out. Could have been human error, could have been a sea skimmer getting too close before being detected. To date, Aegis has been extremely effective against ballistic missiles and old cruise missiles. But given enough time an enemy can test your potential weak spots.