Yes! (1) make certain the magazine is for the 40 caliber - some folk try and use the 9mm mag but I don't think that works. (2) get a couple of factory mags for that cailber or try aftermarket mags. (3) it sounds as if your magazine catch isn't solidly sitting in the cutout of the magazine - look to see if there is any unusual wear at the cutout (bending or slight peening, wear or scratch marks, and look at the mag catch to see if there are any scratches on that - something may have to be relieved a bit in the mag catch cutout. (4) Post this down at the Gunsmithing Forum. The moderator there, gunnut69, may have some suggestions for you. (5) check our sponsors list to see if any of them might be able to sell you the magazines. HTH. Mikey.
Last thought - if you are stuffing 40 S&Ws into a 9mm mag, although they may fit the bullet may be too fat (1 silly milimeter) to allow the mag catch/latch to properly seat in the cutout.