Direction-of-arrival (DOA) estimation is a fundamental functionality of sensor array systems. Previous methods only consider element failure or array imperfections. In fact, the co-existence of element failure and array imperfections is more in line with the realistic operation conditions of an array system. However, the performance of previous methods degrades significantly in the presence of both array imperfections and element failure. To deal with this problem, a robust DOA estimation method is proposed based on a deep neural network (DNN). The proposed DNN consists of a denoising autoencoder (DAE) and a parallel network. The DAE can restore damaged array signals to "non-corrupted" signals, and the parallel network is able to process signals with different levels of loss to improve DOA estimation accuracy. At the training stage, array imperfections are modelled as a spherical distribution, and the training samples are extracted under this distribution to improve the generalisation capability of the proposed network to various array imperfections. In addition, the authors propose to estimate the spatial spectrum in a virtual array beamspace, which can reduce the computational complexity as well as signal-to-noise ratio resolution threshold, and further enhance the robustness to array imperfections. Numerical results show that the proposed DOA estimation approach works well in the presence of both array imperfections and element failure.