Fault detection in PV arrays and inverters is critical for ensuring maximum efficiency and performance. Artificial intelligence (AI) learning can be used to quickly identify issues, resulting in a sustainable environment with reduced downtime and maintenance costs. As the use of solar energy systems continues to grow, the need for reliable and efficient fault detection and diagnosis techniques becomes more critical. This paper presents a novel approach for fault detection in photovoltaic (PV) arrays and inverters, combining AI techniques. It integrates Elman neural network (ENN), boosted tree algorithms (BTA), multi-layer perceptron (MLP), and Gaussian processes regression (GPR) for enhanced accuracy and reliability in fault diagnosis. It leverages its strengths for the accuracy and reliability of fault diagnosis. Feature engineering-based sensitivity analysis was utilized for feature extraction. The fault detection and diagnosis were assessed using several statistical criteria including PBAIS, MAE, NSE, RMSE, and MAPE. Two intelligent learning scenarios are carried out. The first scenario is conducted for PV array fault detection with DC power (DCP) as output. The second scenario is conducted for inverter fault detection with AC power (ACP) as the output. The proposed technique is capable of detecting faults in PV arrays and inverters, providing a reliable solution for enhancing the performance and reliability of solar energy systems. A real-world solar energy dataset is used to evaluate the proposed technique with results compared to existing detection techniques and obtained results showing that it outperforms existing fault detection techniques, achieving higher accuracy and better performance. The GPR-M4 optimization justified its reliably among all the models with MAPE = 0.0393 and MAE = 0.002 for inverter fault detection, and MAPE = 0.091 and MAE = 0.000 for PV array fault detection.