Yes, but they were POLYGONAL forts, not the classic castle. And yes, a Palace is not a fortification.
So while you may attribute the pike and other factors removing the knights, gun and gun warfare did change a lot of things, especially the invention of the actual canon. There are anachronisms and the classic fantasy takes items from the Early Modern (and magic adding some almost high-tech elements to the society), but the Gun might just be a key factor from making it feel like Castles and Wizards or whatever tropes you expect. Adding the gun would likely make it different enough to not feel the same.
As long as you are saying that you just don't like the feel of firearms in your fantasy, I have no problem. The issue I have is when people say that guns would cause some sort of necessary, drastic, and fundamental change in a setting. I don't see any reason for that to be the case. You could probably just drop 16th century firearms into most D&D settings without changing anything else and maintain the usual amounts of historical realism and anachronism found in D&D.