Terahertz time-domain spectroscopy (THz-TDS) achieves excellent signal-to-noise ratios by measuring the amplitude of the electric field in the time-domain, resulting in the full, complex, frequency-domain information of materials' optical parameters, such as the refractive index. However the data extraction process is non-trivial and standardization of practices are still yet to be cemented in the field leading to significant variation in sample measurements. One such contribution is low frequency noise offsetting the phase reconstruction of the Fourier transformed signal. Additionally, experimental errors such as fluctuations in the power of the laser driving the spectrometer (laser drift) can heavily contribute to erroneous measurements if not accounted for. We show that ensembles of deep neural networks trained with synthetic data extract the frequency-dependent complex refractive index, whereby required fitting steps are automated and show resilience to phase unwrapping variations and laser drift. We show that training with synthetic data allows for flexibility in the functionality of networks yet the produced ensemble supersedes current extraction techniques.