The functioning of a photovoltaic (PV) array in the shadow presents significant issues owing to power loss, which affects the harvested power. One of the greatest promising methods for reducing the effect of shadow over the array is reconfiguration. Therefore, this work proposes a modern metaheuristic Binary Firefly Algorithm (BFA) technique for solving the reconfiguration mechanism of a partial shade PV array. The proposed BFA is tested on a 9 × 9 panel PV array with four established shadow arrangements: short wide (SW), long wide (LW), short narrow (SN), and long narrow (LN). The proposed BFA approach yields configurations superior when compared to existing reconfigurations. The best GMP boost obtained with the proposed BFA concerning TCT configuration is 36% in the SW shadow pattern, 30 in the LW arrangement, while the least is 7% in the SN and LN patterns. To evaluate the ability of the proposed system, it is compared with other reconfiguration methods tested across various performance metrics such as fill factor, mismatch power loss, percentage of power loss, and power enhancement. The energy estimates and revenue generation demonstrate that the proposed BFA approach generates 15% more power than the TCT setup and other methods. Furthermore, the Nave Bayes based Machine Learning (ML) approach is applied to detect physical degradation in PV panels. To validate the performance proposed ML method and other techniques are undergone with both faulty and non-faulty conditions. The output of the proposed ML technique-based identification of faults approach is compared to existing techniques. The acquired results supported the proposed BFA with ML's ability and superiority in optimally reconfiguring the shaded array.