Guns would be useful against opponents who 1) were not prepared to face them (as the troll was prepared to face specific threats like sunshine), 2) were not adult wizards with shields raised. So yes, that leaves some options against which a gun in the bag of holding would be useful. (Harry will need to practice firing it though.) You’re right, I’ll update my comment accordingly.
Guns would be useful against opponents who 1) were not prepared to face them (as the troll was prepared to face specific threats like sunshine), 2) were not adult wizards with shields raised. So yes, that leaves some options against which a gun in the bag of holding would be useful. (Harry will need to practice firing it though.) You’re right, I’ll update my comment accordingly.