During a training flight the pilot noticed that the landing gear "in transit" light remained illuminated after the gear retracted. Recycling the gear rectified the problem. When the aircraft returned to the circuit area air traffic control (ATC) queried the pilot as to whether he had a safe indication for the landing gear. The gear was in the retracted position, but the pilot extended it and a safe indication was obtained. Three circuits and landings were then carried out before the aircraft was taxied back to the parking area. The pilot reported having difficulty in maintaining directional control, and thought the aircraft may have suffered a flat tyre. An inspection of the aircraft revealed that the nut had unscrewed from the right main landing gear leg rear attachment bolt, allowing the bolt to withdraw and the gear to droop. This prevented the gear from retracting completely, which ATC had mistaken for a partially extended landing gear. The additional load placed on the forward attachment bolt during gear operation and landings caused severe distortion and bending of the front spar web adjacent to the gear attachment fitting. The reason for the nut to unscrew off the bolt could not be determined. The pilot failed to notice the missing nut during the pre-flight inspection.