Feynman diagrams are more than just the Lagrangian. They can be acquired by expanding the path integral of the theory into a perturbative series. There is a priori no reason to assume that all quantities needed in order to produce sensible results are consistent with gauge invariance.
One possible issue is the problem of regularization: the way your divergent diagrams are regularized is chosen by hand, information about this is not contained in the original Lagrangian. The Pauli-Villars regulator, for example, is not gauge invariant.
Furthermore, there is no guarantee that the measure of the path integral is invariant under gauge transformations. Again, information about the measure is not contained in the Lagrangian.
All those arguments apply also for nonabelian theories, where the issue of gauge invariance only becomes more complicated (BRST symmetry, ghosts,...).