I know maybe a solution. My first mistake when i ticked my secure code, I ticked it in CAPS but that's not necessaire. Exp. when u have WEP with following code: 35 01 F3 84 96, tick in TD then: 3501f38496.
That solved my probem and now i can connect always!
HTC Desire HD
Build number: 1.32.405.6