Due to their extremely high energy density and storage life of more than ten years, specialized lithium/thionyl chloride batteries offer irreplaceable value in demanding operating environments such as downhole oil well instruments, deep-sea equipment, and other enclosed high-temperature operational equipment. However, stresses such as high temperature, high pressure, and physical impact in such confined environments can easily trigger a chain reaction of internal chemical side reactions in the battery, leading to thermal runaway and posing a serious threat to equipment safety. To address these limitations, this study designed a D/Z@PCA composite phase-change aerogel aimed at providing a passive thermal runaway barrier for such batteries. This material utilises mannitol (DM) as the phase-change core and ZIF-8-derived carbon (AZC) as the nucleating agent to construct highly crystalline D/Z phase-change units. Furthermore, through freeze-drying and carbonisation processes, a phosphorus-boron co-doped carbonised aerogel shell (PCA) derived from polyvinyl alcohol (PVA)/cellulose nanofibres (CNF)/ammonium polyphosphate (APP) and sodium tetraborate decahydrate (borax) was constructed on the exterior of the D/Z core. This composite structure firmly encapsulates the phase-change material within a three-dimensional porous network, resulting in excellent dimensional stability. The research findings indicate that D/Z@PCA not only retains a high phase-change enthalpy (231.04 J/g), but also exhibits outstanding thermal isolation characteristics with a thermal conductivity dropping to at least 0.33 W/m·K. In the flame retardancy test, the peak heat release rate of D/Z@PCA decreased by 63.32% compared to that of pure DM, reaching only 426.58 kW/m2, while the total heat release decreased by 82.33%, reaching only 31.13 MJ/m2. The D/Z@PCA aerogel developed in this study integrates high-temperature thermal energy storage, passive thermal insulation, and active fire protection, providing a new material solution for thermal runaway protection of specialized lithium/thionyl chloride batteries in the harsh conditions of high-temperature, enclosed operating environments.