man, that really sounds like it's just a simple connection problem. the fact that you can get it to turn on by knocking it leads me to believe that it might be the battery carrier.
i always keep my TK40 "locked-out" on the nightstand. one time i was showing my friend (a non-flashoholic) how you lock-out the light. i was explaining to him that you do this when you're not going to use the light for a while because there's a "parasitic drain" caused by the type of switch used. i was pushing the button so show him it wouldn't turn on, but then accidently bumped the bezel and it flashed on for a second.
just thinking about this makes me wonder if you should try bending those 4 gold leaf spring thingys. maybe they're smashed down too far. try bending them upwards more. try getting them about halfway between the top of the center gold spring and the highest plastic piece.
i'll go take a picture of the top of my carrier here in a second...
EDIT:
...are your 4 leaf spring things like this? they may need to be even further up than mine. it's possible you have more distance from tail spring to head contacts on your TK40. who knows; your battery tube could be a millimeter or two longer, or your tailcap retainer ring could be a little tighter, or your tail spring could be a tad shorter or smashed down. there could be one little difference in your light that causes it to work differently. a lot can happen in manufacturing. one thing can be off by a little that causes the light to act differently than designed.