Harnessing combustion gases is paramount to reducing the environmental impacts caused by burning fossil fuels. In this study, an innovative solar-natural gas-driven polygeneration system is proposed for the simultaneous production of power, oxygen, and hydrogen to reduce the environmental impacts of the gas turbine flue gas. The system is composed of a Brayton cycle, supercritical carbon dioxide (SCO2) cycle, organic Rankine cycle (ORC), and a polymer electrolyte membrane (PEM) electrolyzer. An integrated Brayton cycle system is placed on top of this system. In order to recover heat from the exhaust gas of the Brayton cycle, the supercritical carbon dioxide (SCO2) cycle and the organic Rankine cycle (ORC) were used to integrate with this heat source. Also, a polymer electrolyte membrane (PEM) electrolyzer has been used to produce hydrogen and oxygen to increase the ability to produce different materials from this system. In the proposed system, part of the PEM electrolyzer power is provided by solar photovoltaic (PV) collectors to further increase the system's environmental performance. Comprehensive energy, exergy, exergoeconomic, and exergoenvironmental (4 E)-analyses are performed to identify the most significant system performance parameters in terms of thermodynamics, economics, and environment. The proposed system is also examined regarding hazard and risk by two different algorithms. Investigating the probability of occurrence of a hazardous event is done with the method of numerical risk analysis, considering the probability of occurrence of three hazardous incidents with the help of thermodynamic analysis results. Moreover, the integrated polygeneration system is optimized via a multi-objective approach combining genetic algorithm and particle swarm algorithm. The results show that the overall thermal and exergy efficiencies and the total system cost rate are 40.95%, 39.49%, and 7174.36 US$/h, respectively. They also indicated that the total system environmental impact rate is 233.01 Pt/h, while the hydrogen production is equal to 114.83 kg/h. The levelized cost of electricity generation is estimated at 0.056 US$/kWh, and the payback period at 1.4 years. Finally, the performance of six different organic fluids were evaluated and the best one was selected according to the 4 E-analysis of the integrated system. The results of 4 E-analysis reveal that R11 fluid presents the best performance compared to other working fluids. The risk analysis performed with fire and explosion indices shows that the system has a low risk. Numerical risk and risk per exergy unit for the integrated system are estimated at 1.92 × 10−5 injured/year and 5.97 × 10−8 injured/year.kW, respectively.