When does the rapid conversion of protons and electrons into neutrons occur during stellar death?

Answer

During the initial, swift compression of the core reaching incredible density.

The precursor to a neutron star or black hole involves the core undergoing a dramatic transformation due to extreme gravitational compression. As gravity forces matter inward to incredibly high densities following the cessation of fusion, the physical conditions become intense enough to overcome the electrostatic repulsion between protons and electrons. These two types of particles are forced together, merging into neutrons in a process that is immediate and central to creating the rigid, dense core structure, often termed the proto-neutron star.

When does the rapid conversion of protons and electrons into neutrons occur during stellar death?
Corestarsupernovacollapseremnant