Guns are not hard to make. Too many people make this mistake when thinking about the difficulty of introducing guns into a fantasy world with magic.
First off, what defines a gun?
A gun is a ranged weapon typically designed to pneumatically discharge solid projectiles[1] but can also be liquid (as in water guns/cannons and projected water disruptors) or even charged particles (as in a plasma gun) and may be free-flying (as with bullets and artillery shells) or tethered (as with Taser guns, spearguns and harpoon guns).
https://en.wikipedia.org/wiki/Gun
In other words, So long as it discharges a projectile, it passes. Normally, it would be a solid lump of metal, like lead. But then you have concepts like shooting out lasers, water, or energy itself.
There is little need to be exact to any of the guns we have here. Which leads to the second point.
Second, what type of gun are you making?
Jumping off the first point. there are many different types of guns that employ different systems to get the same effect. You have the matchlock, Musket, Lever Action, Bolt Action, Shotgun, pistol, revolver, etc. All those guns vary in multiple ways, like the ammo they use, how they propel said ammo, how the effect is triggered, etc. Point is, you aren't limited to just one way, or any of the ways previously employed.
A simple single action revolver can be made rather easily as all you really need is to make the barrel, the hammer, the trigger, handle, and the cylinder. Then connect them so the when the hammer is cocked the trigger can be pulled, releasing said hammer with enough force to cause the ammo to ignite and the bullet to go through the barrel. There's bound to be some trial and error along the way, but since the concept is simple, it won't take long at all to gain the right effect.
Now, bullets, on the other hand, can be a hassle. The modern ammunition is actually far more complicated than most guns. As the cartridge is made up of a bullet(Projectile), the case(holds everything together), propellant(What propels the bullet), rim(helps hold the case in place and can help eject it), and primer(Ignites the propellent).
The bullet, nor the case is all that difficult. However, most people don't know about the rim, but depending on the design of the gun may not even be needed. the primer may take some trial and error, but not too difficult either.
However the propellant will definitely be the biggest issue, as most people will not know the correct ratio for making the gunpowder.
Thought all of the above is absolutely meaningless when you have something as convenient as magic. Propellant? Why the need for gunpowder? Why stick so faithfully to the designs from a world without magic? Substitute certain parts of a bullet with magic powder or so. Or hell, just make the bullet itself a condensed form of magic power. And this brings me to the third point...
Third, Mother fucking magic. Magic is a wonderful little variable that completely negates they very idea of difficulty in making a gun. Depending on the laws of the world, physics, and magic. Making a gun can be absolutely trivial. Need materials? uses earth magic! Need to ignite propellant? Fire or Electric magic! Hell, you may not even need to use gunpowder, just use powdered magic stones! Or make a something entirely different from modern guns, like a magic gun that fires of magic. The basic concept can be utterly simple and easy.
In the end, there are way too many factors to consider to even bother refuting the idea that making a gun is difficult or easy. Especially since the very type of gun can easily change the difficulty and there is no need to even be trapped in one or any type of gun. So long as its a ranged weapon typically pneumatically discharges solid(But not limited to it) projectiles. It's a gun. Though whether it'll be effective or even worth the effect is another debate entirely.