FACTS based devices are mostly used in power systems due to their capacity to improve system stability. The Static Synchronous Compensator (STATCOM), a shunt-connected device in the FACTS device family, is used for power compensation, power balancing, and enhancing dynamic stability in contemporary power systems. In the proposed work, STATCOM based novel nine level switched capacitor based multi-level inverter (MLI) is used to reduce power quality issues. The proposed novel inverter has a few number of switches with one voltage source. The placement of STATCOM based inverters in the wrong places may have detrimental effects on power loss and electricity quality. To overcome these issues, green anaconda optimization (GAO) is used to allocate the proposed system in an optimal place. The performance of the proposed inverter is examined using the MATLAB/Simulink tool. This inverter requires fewer switches and achieves DC link voltage balances in comparison to any other existing conventional topologies. STATCOM based inverter is validated under different faulty conditions to show the effectiveness of this inverter. The proposed new inverter has nine levels and compensates for the poor state while improving power quality. The proposed method has a substantially lower total harmonic distortion (THD) of 1.04 % while maintaining an efficiency of 99.02 %. Experimental validation is established using a dSPACE RTI1104 controller to validate the proposed method. Experimental results obtained 1.04 % of harmonics with the same output voltage as the simulation.