This paper proposes a novel mitigation technique for soft error effects on the attitude estimation (AE) processing for spacecrafts, especially for satellites' application. Specially, we are focused on the soft errors that occur in space and affect, for example, the quaternion Kalman filter, running on the processor of control system of satellite, which leads to invert bits of the estimated states, miscalculations and a decreased performance. The mitigation technique detects first the presence of soft error effects on the AE algorithm output using some residuals. Then the residuals are passed to a trained Machine Learning (ML) models to estimate the quaternion error that will be used to correct the estimations. A supervised regression solution was proposed to correct the soft error effects, in which a methodology for creating a dataset for training classical ML models was developed. The results from the case-study scenario show a high reduction of soft error effects, while adding little overhead to the Kalman filter processing.