The paper presents theoretical studies on the domain wall energy losses that arise when it moves through the magnetic defect region. These losses are largely related to the generation of localized magnetization waves in the defect region. It is shown that the process of the domain wall energy scattering on the defect can be regarded as a new "channel of damping" for a domain wall. The study was carried out using numerical and analytical methods through the example of a three-layer model of the ferromagnetic structure, in which the intermediate layer differs in its physical parameters from the rest of the crystal. The intermediate layer (or magnetic defect) was simulated by a spatial modulation of the magnetic parameters. The modes of motion, in which "effective damping" is minimal, were calculated. The damping value depends on the excitation energy of the localized waves and is determined by the ratio of the defect properties and initial velocity of the domain wall motion. It is specifically shown that an increase in the domain wall energy loss is associated with the increase in the localized waves oscillations amplitude. In this case, the dependence of the localized waves oscillations amplitude on the domain wall initial velocity only has one maximum. It is at this point that the domain wall energy losses are maximal. They can be significantly reduced if the domain wall velocity is noticeably higher or lower than the maximum. This behavior was studied for both the point and extended defects.