Albeit the codebase is a mess, gbaemu4ds allows (as long you can boot a game) to fix save issues in pokemon games (except emerald or romhacks, which do not boot, use gbarunner2 instead)
https://bitbucket.org/Coto88/gbaemu4ds/get/HEAD.zip
You need to download that, copy /release folder contents onto SD card.
Copy gba file, must have (filename).gba extension. Then the corrupted savefile (the one saying this save is corrupted, but still loads), must be copied and renamed to have (filename).sav extension.
boot hbmenu, choose gba file, and FORCE TO Flash 128K. Right before emulation starts you will be asked to either auto detect the savetype or to select the one you forced earlier, choose the force option.
After that the game will load and a [SAVEFIX] message will appear on screen. Game will boot and you will be greeted with the corrupted save, but still will be able to load the savefile. Load the game. Then, save ingame like you normally would do, at least 2 times. Wait 10 seconds (in between) and then press Y. Music will freeze for a moment, when Music resumes, turn off the DS. And savefile will be fixed using the raw Flash 128K format.
Edit: You need a slot-1 flashcard for this