The most likely reason you had problems with the gun is the nipple cone is slightly too large for the caps that were causing the problem.
When this happens, the cap stops on the cone too soon and the priming powder is not touching the end of the nipple.
With percussion caps that are too small for the nipple the first hammer blow pounds the cap further down on the nipple. This usually ends up with the cap firing the next time the hammer is cocked and fired but as you found, not always.
Caps made by different companies are slightly different in size so by switching to a different brand, you found some caps that fit the nipple better so they fired as they should.
Many of us who have had this problem have lightly chucked the nipple in an electric drill and then, with the drill slowly running, used a flat file to carefully reduce the size of the cone. This can be hard on files because the nipples are hardened but the file will cut them.
If you try this I recommend chucking on the body of the nipple rather than the threads. Try to match the existing angle of the cone with the file. Also, stop often and check the fit of the problem caps. You don't want to remove too much of the cone.
Being a flintlock shooter you were probably using real black powder which should fire easily. If you were using one of the synthetic powders their higher ignition temperature will sometimes cause a hang fire or a mis-fire.