Metal halide perovskite solar cells (PSCs) are promising as the next-generation photovoltaic technology. However, the inferior stability under various temperatures remains a significant obstacle to commercialization. Here, we implement a heat-triggered dynamic self-healing framework (HDSF) to repair defects at grain boundaries caused by thermal variability, enhancing PSCs' temperature stability. HDSF, distributed at the grain boundaries and surface of the perovskite film, stabilizes the perovskite lattice and releases the perovskite crystal stress through the dynamic exchange reaction and shape memory effect of sulfide bonds. The resultant PSCs achieved a power-conversion efficiency (PCE) of 26.32% (certified 25.84%) with elevated temperature stability, retaining 94.2% of the initial PCE after 500 h at 85℃. In a variable temperature cycling test (between −40℃ and 80℃), the HDSF-treated device retained 87.6% of its initial PCE at −40℃ and 92.6% at 80℃ after 160 thermal cycles. This heat-triggered dynamic self-healing strategy could significantly enhance the reliability of PSCs in application scenarios.