We study the problem of propagating longitudinal waves in an elastic rod connected to a locally damaged foundation through a thin elastic layer. The motion of the rigid foundation blocks is considered predetermined. We formulated the initial-boundary problem for the Klein--Gordon equation with a discontinuous right-hand side. The nonstationary fields of displacements, velocities, and deformations were investigated by the Laplace integral transformation method. Examples of sudden divergence of fragments of the foundation by a given value and their mutual separation at a constant speed are considered.