An extensive investigation of the origin and the impact of periodic sampling errors of terahertz time-domain spectroscopy systems is given. We present experimental findings and compare them to a theoretical model which is developed in this work. Special attention is given to the influence on the extraction of the refractive index from measurements. It can be shown that even distortions of the spectrum at frequencies higher than the used bandwidth can have a significant impact on the extracted refractive index.