If it's 3rd gear there is a possibility it's being caused by the rubber shift boot. Most of the ones sold for Cobra type cars are too thick and stiff. Mine was popping out of 3rd every once in awhile. I could put the shifter in 3rd and release it and see the boot pull it rearward.
I bought a new boot sold by Sunbeam Specialties which looks just like the Cobra boot but is thinner and more flexible. I installed it about 2 years ago and haven't experienced a 3rd gear pop-out since.
If you decide to try one the easiest thing to do is just call them up and order over the phone. They will know what you're looking for as I think they sell quite a few of them to Cobra guys.
Sunbeam Specialties - Number 1 Source for Rootes Sunbeam Alpine-Tiger Parts. We carry the most extensive range of mechanical, hydraulic, upholstery and restoration parts available.
I should add it's easy to check if this is the problem by just removing the screws from the trim ring and boot and leave it loose and see if it pops out of 3rd.