The research community is giving a great deal of attention to perovskite solar cells (PSCs) due to the rapid increase in their power conservation efficiency (PCE), which has reached 25.7% in a relatively short period of time. Nevertheless, the hazardous nature of (Pb) based perovskites, which are the most prevalent, has been a significant hindrance to its commercial viability. Cations with similar properties, including Ge2+ and Sn2+, have been studied due to their similar oxidation states to Pb2+. Earlier research has shown that the outcome of the degradation of γ-CsSnI3 is Cs2SnI6, as the Sn2+ ion experiences an oxidation process and transforms into Sn4+. In this study, a numerical evaluation was conducted using the SCAPS-1D program with the aim of improving the stability and performance of a device that has already been demonstrated experimentally (ITO/NiOx/γ-CsSnI3/PCBM/Al). First, we have chosen a p-n junction (γ-CsSnI3-Cs2SnI6) rather than a classical p-n junction (γ-CsSnI3-PCBM). The n-type Cs2SnI6 is deposited on the p-type γ-CsSnI3 because it has the potential to prevent or slow down further degradation of the γ-CsSnI3, thus acting as a protective layer. Subsequently, the optimization of the γ-CsSnI3 layer was carried out by altering its thickness, reducing the number of defects (Nt), and controlling the concentration of acceptors (NA). We also optimized the concentration of defects at NiOx/γ-CsSnI3 and γ-CsSnI3/Cs2SnI6 interfaces. We also looked into how variables such as the ITO work function, shunt resistance, series resistance, and temperature influence the device's performance. Finally, we successfully obtained a stable lead-free solar device with an efficiency of 8.48% when measured at room temperature and 9.12% when measured at 280 K.