Context. A number of He-rich hot subdwarf stars present high abundances for trans-iron elements, such as Sr, Y, Zr, and Pb. Diffusion processes are important in hot subdwarf stars and it is generally believed that the high abundances of heavy elements in these peculiar stars are due to the action of radiative levitation. However, during the formation of He-rich hot subdwarf stars, hydrogen can be ingested into the convective zone driven by the He-core flash. It is known that episodes of protons being ingested into He-burning convective zones can lead to neutron-capture processes and the formation of heavy elements. Aims. In this work, we aim to explore, for the first time, whether neutron-capture processes can occur in late He-core flashes taking place in the cores of the progenitors of He-rich hot subdwarfs. We aim to explore the possibility of a self-synthesized origin for the heavy elements observed in some He-rich hot subdwarf stars. Methods. We computed a detailed evolutionary model for a stripped red-giant star using a stellar evolution code with a nuclear network comprising 32 isotopes. Then we post-processed the stellar models in the phase of helium and hydrogen burning using a post-processing nucleosynthesis code with a nuclear network of 1190 species, which allowed us to follow the neutron-capture processes in detail. Results. We find the occurrence of neutron-capture processes in our model, with neutron densities reaching a value of ∼5 × 1012 cm−3. We determined that the trans-iron elements are enhanced in the surface by 1 to 2 dex, as compared to initial compositions. Moreover, the relative abundance pattern [Xi/Fe] produced by neutron-capture processes closely resembles those observed in some He-rich hot subdwarf stars, hinting at a possible self-synthesized origin for the heavy elements in these stars. Conclusions. We conclude that intermediate neutron-capture processes can occur during a proton ingestion event in the He-core flash of stripped red-giant stars. This mechanism offers a natural channel for the production of the heavy elements observed in certain He-rich hot subdwarf stars.