This would be because of the emulation processing issue in where it limits the amount of RAM used within the program itself. It's been well known in HeartGold/SoulSilver and Black 2/White 2, so to prevent this problem from occurring... you may need to use an Action Replay code or use some patch on the ROM itself, if you don't want to use an Action Replay code... that's fine, just make sure you save often during the ROM hack. lol
I wish those developers of DeSmuME would start fixing those issues, but since they don't support Pokémon games... it makes me feel like starting a fork of the DeSmuME source code, but even so... I haven't learned about programming yet. But once I do... I might start up my own team that will work on DeSmuME to improve DS emulation and start DSi Emulation.