In this work, we present new global QCD analyses, referred to as PKHFF.23, for charged pion, kaon, and unidentified light hadrons. We utilize a Neural Network to fit the high-energy lepton-lepton and lepton-hadron scattering data, enabling us to determine parton-to-hadron fragmentation functions (FFs) at next-to-leading-order (NLO) accuracy. The analyses include all available single-inclusive e+e− annihilation (SIA) and semi-inclusive deep-inelastic scattering (SIDIS) data from the COMPASS Collaboration for charged pions, kaons, and unidentified light hadrons. Taking into account the most recent nuclear parton distribution functions (nuclear PDFs) available in the literature, we evaluate the effect of nuclear corrections on the determination of light hadrons FFs. The Neural Network parametrization, enriched with the Monte Carlo methodology for uncertainty estimations, is employed for all sources of experimental uncertainties and the proton PDFs. Our results demonstrate that incorporating nuclear corrections at NLO accuracy impacts the central values of FFs and the corresponding uncertainty bands. Additionally, this inclusion has the potential to improve the fit quality of the data as well.