Perovskite p-n homojunctions (PHJ) have been confirmed to play a crucial role in facilitating carrier separation/extraction in the perovskite absorption layer and provide an additional built-in potential, which benefits the inhibition of carrier recombination in perovskite solar cells (PSCs) and ultimately improves device performance. However, the diffusion and migration of ions between n-type and p-type perovskite films, particularly under operational and heating conditions, lead to the degradation of PHJ structures and limit the long-term stability of PSCs with PHJ structure (denoted as PHJ-PSCs). In this study, we propose an insert layer strategy by directly introducing an ultra-thin polyetheramine (PEA) layer between the n-type and p-type perovskite films to address those challenges arising from ion movements. Femtosecond transient absorption (fs-TAS) and photoluminescence (PL) measurements demonstrate that the PHJ (without and with the insert layer) enhances carrier separation/extraction compared to the single n-type perovskite film. Monitoring the evolution of bromine element distribution reveals that the insert layer can efficiently suppress ion diffusion between perovskite films, even under long-term illumination and heating conditions. Consequently, an efficiency of 23.53% with excellent long-term operational stability is achieved in the optimized PHJ-PSC with the insert layer.