In this study, the graphene-based copper antimony sulfide (CuSbS2) thin film solar cells (TFSCs) has been modeled by utilizing the software Silvaco TCAD. Further, the Random forest model is utilized to predict the efficiency using different absorber layer thicknesses. The effectiveness of the Random forest model is evaluated with Root mean squared error (RMSE) value (0.0231) and R2 score (0.9997). The CuSbS2 is a hole transport and absorber layer due to its high optical absorption coefficient, low cost, and vacuum-free fabrication methods. Whereas, transparent conducting electrode is with graphene because of its remarkable transparency and high conductivity. A novel heterojunction-based solar cell (Graphene/n-TiO2/p-CuSbS2/Au) has been proposed. The proposed solar cell for optimized absorber thickness (350 nm) has a maximum power conversion efficiency (PCE) of 17.42 %, where the open circuit voltage (Voc) is 830 mV, short circuit current (Jsc) is 34.44 mA/cm2, and the fill factor (FF) is 60.93 %. In addition, the effects of different parameters such as thickness, back contact, bandgap, carrier concentration, temperature, and defect density have been also studied for which the device efficiency depends. The device exhibits good performance stability at high temperatures. The observed results suggested that the proposed flexible solar cell can be used as a power source in the future for electric automobiles, unmanned aerial vehicles, building integrated photovoltaic systems, space robots, and wearable electronics.