High-intensity lasers interacting with solid foils produce copious numbers of relativistic electrons, which in turn create strong sheath electric fields around the target. The proton beams accelerated in such fields have remarkable properties, enabling ultrafast radiography of plasma phenomena or isochoric heating of dense materials. In view of longer-term multidisciplinary purposes (e.g., spallation neutron sources or cancer therapy), the current challenge is to achieve proton energies well in excess of 100 MeV, which is commonly thought to be possible by raising the on-target laser intensity. Here we present experimental and numerical results demonstrating that magnetostatic fields self-generated on the target surface may pose a fundamental limit to sheath-driven ion acceleration for high enough laser intensities. Those fields can be strong enough (~10⁵ T at laser intensities ~10²¹ W/cm²) to magnetize the sheath electrons and deflect protons off the accelerating region, hence degrading the maximum energy the latter can acquire.