The Phantom was designed to be a fleet interceptor, not a dogfighter. Once it was pressed into the role of providing air superiority over Vietnam, it had troubles due to restrictive rules of engagement, a poor missile in the AIM7, and yes, a lack of guns. The Navy also suffered from a lack of ACM training that they rectified with the TOPGUN program. But to put all of these problems at the foot of the Phantom is missing the forest for the trees.
And once changes were implemented in these areas, the Phantom went on to excel as an aircraft in the USN, the AF, and the airforces and navies of many other countries.
If you look at the entire lifespan of the Phantom, its obvious that it was an overwhelming success.