The electronic structures of metals undergo transient nonequilibrium states during the photoexcitation process caused by isochoric heating of X-ray free-electron laser, and their lattice stability is, thus, significantly affected. By going beyond frozen core approximation, we manually introduced nonequilibrium electron distribution function in finite-temperature density functional theory with the framework of Kohn–Sham–Mermin to investigate such transient states, and their effect on lattice stability in metals is demonstrated by phonon dispersion calculated using the finite displacement method. We found that the perfect lattice of a metal collapses due to the exotic electronic structure of nonequilibrium transient state created by isochoric heating of X-ray free-electron laser. Further increase of the number of holes created in the sample (i.e., an increase of laser fluence) still results in lattice instability for aluminum, while for copper, it results in phonon hardening. The potential energy surface is calculated for the extreme case of both Al and Cu with exactly one hole created in its inner shell for each one of the atoms. A double-well structure is clearly observed for Al, while the potential energy surface becomes steeper for Cu.