In the fireworks industry (FI), many accidents and explosions frequently happen due to human error (HE). Human factors (HFs) always play a dynamic role in the incidence of accidents in workplace environments. Preventing HE is a main challenge for safety and precautions in the FI. Clarifying the relationship between HFs can help in identifying the correlation between unsafe behaviors and influential factors in hazardous chemical warehouse accidents. This paper aims to investigate the impact of HFs that contribute to HE, which has caused FI disasters, explosions, and incidents in the past. This paper investigates why and how HEs contribute to the most severe accidents that occur while storing and using hazardous chemicals. The impact of fireworks and match industry disasters has motivated the planning of mitigation in this proposal. This analysis used machine learning (ML) and recommends an expert system (ES). There were many significant correlations between individual behaviors and the chance of HE to occur. This paper proposes an ML-based prediction model for fireworks and match work industries in Sivakasi, Tamil Nadu. For this study analysis, the questionnaire responses are reviewed for accuracy and coded from 500 participants from the fireworks and match industries in Tamil Nadu who were chosen to fill out a questionnaire. The Chief Inspectorate of Factories in Chennai and the Training Centre for Industrial Safety and Health in Sivakasi, Tamil Nadu, India, significantly contributed to the collection of accident datasets for the FI in Tamil Nadu, India. The data are analyzed and presented in the following categories based on this study’s objectives: the effect of physical, psychological, and organizational factors. The output implemented by comparing ML models, support vector machine (SVM), random forest (RF), and Naïve Bayes (NB) accuracy is 86.45%, 91.6%, and 92.1%, respectively. Extreme Gradient Boosting (XGBoost) has the optimal classification accuracy of 94.41% of ML models. This research aims to create a new ES to mitigate HE risks in the fireworks and match work industries. The proposed ES reduces HE risk and improves workplace safety in unsafe, uncertain workplaces. Proper safety management systems (SMS) can prevent deaths and injuries such as fires and explosions.