Dynamics of body skeletons convey significant information for human gait recognition. However, it is inevitable that missing points, overlapping error, or confusion of left and right error will frequently occur during the process of skeleton estimation. Existing skeleton-based methods have difficulty in achieving satisfactory performance in gait recognition since they treat the noisy data and the normal data equally to the recognition process. In this paper, we propose a novel skeleton-based model called Siamese Denoising Autoencoder networks (Siamese DAE), which can automatically learn to remove position noise, recover missing skeleton points and correct outliers in joint trajectories. More precisely, we construct an encoder that compresses the characteristics of input trajectories into a latent space and a decoder that attempts to reconstruct more accurate skeleton trajectories from the latent feature. The corrected joint trajectories not only lead to higher discriminative power but also stronger generalization capability. Moreover, we design a Siamese structure to reduce intra-class variations and increase inter-class variations of the encoded features. Experiments demonstrate that our method enhances the robustness against inaccurate skeleton estimation and achieves substantial improvements over mainstream skeleton-based methods for gait recognition.