yeah that happens when you turn too much codes on at the same time. I had something somewhat similar happen to me in FRLG a long while back.
I think all my items became balls, including key items. It's nice to have infinite items in Key Items bag, but it replaced some crucial key items, which were a pain.
Beyond what was already said about using PKHeX, if you can't get your save to use it (tho most older ARs should have a save dumping feature?), consider looking for a code to wipe your bag.