Flexible magnetic films have been widely investigated as a potential sensor to detect the stress or strain induced by bending. Nevertheless, the stable magnetic response is highly required in the case of wearable devices in which the bending-induced sensitivity variation should be minimized. Therefore, it is highly worthwhile to propose an approach to design a flexible magnetic film in need. Here, a flexible magnetic thin film of the potential spin gapless semiconductor CoFeMnSi (CFMS) is fabricated on an aluminum foil (Al foil), which is sensitive to the stress or strain induced under bending; but it was found that inserting a Ti3C2 MXene buffer layer, which acts as a sponge-like behavior, can significantly improve the magnetic response stability inert of the stress or strain. Impressively, the Hc can keep relatively constant under bending and the magnetic hysteresis loops remain unchanged even after repeated bending. Through the finite element calculation, we clarify the working mechanism of stress releasing by the buffer layer owing to the sponge-like elastic behavior. Our work proposes a novel approach to design flexible devices towards in need of tunable or endurable properties, and gives a theoretical instruction of selecting a buffer layer.