The thing about using spells to defend against guns is you need to know it is coming. There is also the possibility of getting muggleborns, goblins, or whatever else to make bullets that can go through most shields. Diplomacy is a thing.
The punisher, Batman, Snake (either one)... basically anyone who can pull off an ambush. A wizard that gets shot is just as dead as anyone else, they just have an easier time preventing themselves from getting shot if they have warning.