Further to the other good suggestions:
What rig are you ground testing the gear with? Is it producing constant normal system pressure? It it's retracting the gear at a lower pressure in the hangar, perhaps the seal isn't leaking to the other side of the ram, as it might when using the engine-driven hydraulic system at
full pressure. I'd be tempted to remove the actuator and test it at 1.5 x normal px with the return port uncapped to see if there's any leakage.
The other possibility is (I may well be wrong as I've not worked on a Titan for a long time) is that the downlock microswitch on the actuator is defective, which is sending a pressure cut-off signal to the hydraulic system once the other gears have retracted. But that doesn't explain why the system works fine when the a/c is on jacks. It would be interesting to see the system hydraulic/electrical schematic.
Has it got a spring-loaded downlock inside the actuator?