To investigate the static magnetic field generated by a proton pencil beam as a candidate for range verification by means of Monte Carlo simulations, thereby improving upon existing analytical calculations. We focus on the impact of statistical current fluctuations and secondary protons and electrons. We considered a pulsed beam (10 s pulse duration) during the duty cycle with a peak beam current of 0.2 A and an initial energy of 100MeV. We ran Geant4-DNA Monte Carlo simulations of a proton pencil beam in water and extracted independent particle phase spaces. We calculated longitudinal and radial current density of protons and electrons, serving as an input for a magnetic field estimation based on a finite element analysis in a cylindrical geometry. We made sure to allow for non-solenoidal current densities as is the case of a stopping proton beam. The rising proton charge density toward the range is not perturbed by energy straggling and only lowered through nuclear reactions by up to 15%, leading to an approximately constant longitudinal current. Their relative low density however (at most 0.37 protons/mm3 for the 0.2 A current and a beam cross-sectionof 2.5mm), gives rise to considerable current density fluctuations. The radial proton current resulting from lateral scattering and being two orders of magnitude weaker than the longitudinal current is subject to even stronger fluctuations. Secondary electrons with energies above 10eV, that far outnumber the primary protons, reduce the primary proton current by only 10% due to their largely isotropic flow. A small fraction of electrons (<1%), undergoing head-on collisions, constitutes the relevant electron current. In the far-field, both contributions to the magnetic field strength (longitudinal and lateral) are independent of the beam spot size. We also find that the nuclear reaction-related losses cause a shift of 1.3mm to the magnetic field profile relative to the actual range, which is further enlarged to 2.4mm by the electron current (at a distance of mm away from the central beam axis). For mm, the shift increases linearly. While the current density variations cause significant magnetic field uncertainty close to the central beam axis with a relative standard deviation (RSD) close to 100%, they average out at a distance of 10cm, where the RSD of the total magnetic field drops below 2%. With the small influence of the secondary electrons together with the low RSD, our analysis encourages an experimental detection of the magnetic field through sensitive instrumentation, such as optical magnetometry orSQUIDs.