Monte Carlo simulations are nowadays essential tools for a wide range of research topics in the field of radiotherapy. They also play an important role in the effort to develop a real-time monitoring system for quality assurance in proton and carbon ion therapy, by means of prompt-gamma detection. The internal theoretical nuclear models of Monte Carlo simulation toolkits are of decisive importance for the accurate description of neutral or charged particle emission, produced by nuclear interactions between beam particles and target nuclei. We assess the performance of Geant4 nuclear models in the context of prompt-gamma emission, comparing them with experimental data from proton and carbon ion beams. As has been shown in the past and further indicated in our study, the prompt-gamma yields are consistently overestimated by Geant4 by a factor of about 100% to 200% over an energy range from 80 to 310 MeV/u for the case of (12)C, and to a lesser extent for 160 MeV protons. Furthermore, we focus on the quantum molecular dynamics (QMD) modeling of ion-ion collisions, in order to optimize its description of light nuclei, which are abundant in the human body and mainly anticipated in hadrontherapy applications. The optimization has been performed by benchmarking QMD free parameters with well established nuclear properties. In addition, we study the effect of this optimization on charged particle emission. With the usage of the proposed parameter values, discrepancies reduce to less than 70%, with the highest values being attributed to the nucleon-ion induced prompt-gammas. This conclusion, also confirmed by the disagreement we observe in the case of proton beams, indicates the need for further investigation on nuclear models which describe proton and neutron induced nuclear reactions.