We examine the Jarzynski equality for a quenching process across the critical point of second-order phase transitions, where absolute irreversibility and the effect of finite-sampling of the initial equilibrium distribution arise in a single setup with equal significance. We consider the Ising model as a prototypical example for spontaneous symmetry breaking and take into account the finite sampling issue by introducing a tolerance parameter. The initially ordered spins become disordered by quenching the ferromagnetic coupling constant. For a sudden quench, the deviation from the Jarzynski equality evaluated from the ideal ensemble average could, in principle, depend on the reduced coupling constant ε0 of the initial state and the system size L. We find that, instead of depending on ε0 and L separately, this deviation exhibits a scaling behavior through a universal combination of ε0 and L for a given tolerance parameter, inherited from the critical scaling laws of second-order phase transitions. A similar scaling law can be obtained for the finite-speed quench as well within the Kibble-Zurek mechanism.