Just adding to this thread as mine had the same problem.
The catch is a tiny lug on the end of a plastic arm that swings left and right at the top of ashtray holder (out of sight when in place). When the holder is pushed up to close it the lug fits over another bit of plastic which holds it in place - the lug on mine was worn away to almost nothing and so the lightest of taps would dislodge it. Also the ham-fisted previous owner of my car had obviously had a temper tantrum with it at some point and hammered the whole assembly about - result - the arms on the holder were smashed to bits, and the mounting brackets they screw into on the surrounding trim panel were also smashed to bits. He'd tried to hold it all together with big washers around the existing screws, which didn't really work too well.
So to fix it:
1. Open the holder and pull the fag lighter and ashtray out and put to one side
2. Unscrew the two screws on either side of the holder
3. Pull the holder towards you. There is a spike at the back that goes into a hole in the back of the cavity so it needs to come out straight. It will not come away completely as there's a wiring connector.
4. Unplug the wiring connector - gentle pressure on the handle bits either side and just pull
5. On top of the holder you'll see the arm that swings left/right in a little greased channel. If the lug is worn you could try supergluing a small chunk of metal or plastic on to make it bigger, or just get another holder from a scrappy
6. Refitting is the opposite of the above as they say
If your brackets either side are knackered you'll need a new trim panel too, again easily had from a scrappy...
6. Unscrew the two screws at the back of the cavity the holder was in
7. Remove the non-slip liner at the bottom of the cavity
8. The silver surround to the gearstick is just clipped in place, gently lever it up (probably easiest from the edge nearest the handbrake). Undo the gearstick gaiter and you can slip the whole assembly over the stick and pull it away. The attaching cables are long enough to put it to one side for now
9. Undo the two screws revealed nearest the handbrake side of the hole
10. Slide the whole black trim bit towards the handbrake to release the clips at the back then wiggle it up and away (best done with handbrake up as high as you can get it). You can thread the silver panel with the gearstick gaiter through the hole it sits on normally
11. Marvel at the dirt round the edge, then clean the damn thing
12. Refitting is the opposite of the above