Residual generation and hypothesis test are two important components in fault detection techniques. Recent studies mainly focused on enhancing residual generation algorithms, but often overlook the Gaussian distribution assumption that necessary for hypothesis test. Based on the conditional invertible neural network (CINN), this study proposes a novel approach for mapping residual signals into near-Gaussian distributed latent variables, thereby enhancing the reliability and effectiveness of the hypothesis test approaches used for fault detection. With the specially designed architecture using CINN, the proposed mapping from residual signals to latent variables has no information loss, thus guaranteeing the accuracy of the proposed fault detection method. The main contributions of this study are two-fold: 1) To ensure that the latent variables are distributed similarly to an ideal Gaussian distribution, a novel CINN training approach is proposed; 2) historical process information is incorporated into the residual-to-latent variable mapping, dynamically refining the mapping procedures in response to the system behavior. This approach is primarily used to tackle the challenges posed by non-additive and non-Gaussian noises in industrial systems. A DC speed control system and a waste water treatment system are adopted to verify the effectiveness of the proposed fault detection approach.