Compared with the traditional antenna array, the time-modulated array can increase the flexibility of the array by adding time switches. However, due to the introduction of time switches, the timemodulated array antenna is more sensitive to random errors than the traditional array. Besides random errors caused by unavoidable factors such as array deformation and defects of processing and assembly in the traditional array, time-modulation parameter errors will be introduced by time switches. As errors in the traditional array can degrade the performance of the array, time-modulation parameter errors can lower the performance of the array pattern as well, which will lift the side-lobe and increase the dynamic range of the side-lobe. Aiming at the time-modulation parameter errors in the time-modulated array, an anti-error robust pattern synthesis algorithm (AERPS) based on the convex optimization (CVX) is proposed in this paper. In the algorithm, the optimization model for the pattern synthesis of the time-modulated array is established and analyzed. Then the model is divided into two sub-models of the center frequency and the first sideband, and the convex optimization solution is first performed on the center frequency model. After the center frequency model is solved, the convex optimization solution is used to solve the first-order sideband model to obtain the final results. The simulation results of the time-modulated array in this paper show that the algorithm can reduce the average value and the dynamic range of the normalized side-lobe level, thus verifying the effectiveness and the robustness of the algorithm.