We study the non-equilibrium quench dynamics crossing a continuous phase transition between the charge density wave (CDW) and supersolid (SS) phases of a bosonic lattice gas with cavity-mediated interactions. When changing the hopping amplitude in the Hamiltonian as a function of time, we investigate the scaling behavior of the correlation length and vortex density with respect to the quench time and find that there is a threshold of the quench rate separating two distinct scaling regimes. When slowly varying the system below that threshold, we find a power-law scaling as predicted by the Kibble–Zurek mechanism (KZM). While considering fast quench above that threshold, a deviation from the KZM prediction occurs, manifested by a saturation of the defect density. We further show that such distinct scaling behaviors during different dynamic procedures can be understood through comparing the relaxation time and the quench rate.