Guns are totally fine for me, it's just that mamy authors don't use them well. They don't have to be balanced or anything, it's completely fine if one is way better than the other, you just need to have excusivity. If magic is exclusive to a small number of mages, then the common folk, who have no magic, will resort either to magitech (or some other name for a similar concept) or physics - guns included if the world is sufficiently advanced. Considering that magitech will be too expensive for the common folk and likely to be resticted, and there's only one remaining answer.
It'll differ across various settings, that's a given, but still. Point is, if something is restricted, sooner or later something else will replace it, and even if it's worse, it'll still be used.
In other kinds of settings, guns can be used as the undetectable weapon, because if we have a world where each magic user can sense magic, including for example spells, traps, wards, and other magic users in their vicinity, then a gun will be weapon that, while likely weak, is undetectable, or at least less visible, than any equally powerful magical attack or weapon.
There's a ton of other ways to use them, for example in a world where each person only has one specific kind of power, and guns can supplement it, or in stories with conditional/ritualistic/expensive/unpredictable magic, where a gun might not be a great weapon, but where it's faster and more reliable than magic.
I say that guns are boring only if they are used badly. There's a lot of ways to make them great, if not as a part of worldbuilding itself, then to spice up the plot with another variable. And that doesn't only apply to crude weapons like muskets or pistols, but even modern rifles and other advanced guns.
My personal favorite level of advancement for a fantasy world with both guns and magic is either around today's, maybe a bit lower, or completely futuristic, the last of which has a huge downside of being very difficult to write.
They also can be cool, or rather, they have their own unique potential. There's a reason why gunslinger is its own, well-liked class in many games, and it's not just the weapon they hold. From experience, though, I'd say while their cool factor isn't generally that great, they have huge potential to be badass instead.