The integration of photovoltaic (PV) systems into the power grid has become increasingly prevalent, providing sustainable and renewable energy solutions. However, the occurrence of islanding events, where a portion of the PV system operates independently from the main grid, presents challenges in maintaining power quality. This research paper investigates the harmonic distortions during islanding in grid-connected PV systems and proposes effective mitigation strategies. The study employs advanced simulation tools to analyse the dynamic behavior of the PV system during islanding scenarios, focusing on the occurrence and characteristics of harmonics. A detailed investigation into the root causes of harmonic distortions is conducted, considering factors such as grid fluctuations, inverter operation, and system impedance. Based on the findings, this paper introduces novel harmonic mitigation techniques tailored for islanding conditions. These techniques encompass advanced control algorithms, filter designs, and modulation strategies to suppress harmonics and enhance the overall system performance during islanded operation. Comparative assessments of different mitigation approaches are presented, evaluating their effectiveness in minimizing harmonic distortions and maintaining grid code compliance. The research contributes valuable insights to the field of grid-connected PV systems, offering a comprehensive understanding of harmonic issues during islanding events and proposing innovative solutions for their mitigation. The outcomes of this study are crucial for advancing the reliability, stability, and power quality of PV systems that are connected to the grid, which makes it possible for green energy sources to be added to the grid without any problems.