I have had experience like this before when buying pokemon games( firered, emerald) of eBay. If I shook or dropped the ds or gameboy the game would become corrupted or turn off, if I tried to play another game while they are both in the ds( especially happening to me while trying to migrate old pokemon) it would also not work yen say hat the file has become corrupted. There is no real way to fix this, it's basically since eBay is always quite dogy, especially when buying old games, like emerald. My friend had an emerald that he bought when it came out, and when I played it I had none of the problems that I mentioned above. In conclusion, the answer is that there is nothing that you can do really, and that it's ebays fault.
Sources: personal experience.