Yeah, we always think "if you have gunpowder you have uzis" or something. We had gunpowder early in the 9th century (it was use a medicine in the 8th century) and it wasn't until the 13th century that cannon became commonplace. Gunpowder was prohibitively expensive for a long time. People were still running around in armor a couple centuries later.But gunpowder existed and was used for war for what historians call “a long-ass time” before things got remotely industrial. Heck, even castle walls took a while to stop being used.
Just don’t have gunpowder have been around for hundreds of years, and no one will bat an eye at the fact that people still carry swords and wear plate armor and hide behind stone walls.
Of course in our world magic doesn't work but gunpowder does. No reason to believe in a world where magic works gunpowder would.