this.
i figured you did this - like i said, thats not how it works, u HAVE to switch magikarp BACK in or it doesnt count. he was there for teh first fight, but both pokes got switchd, u kill the 2nd onyx but failed to reface the 1st w magikarp. giving all xp to manky, who was present for BOTH fights. or rather 3 since it was onyx1/manky then onyx2/manky and then back to onyx1/manky.
but. it could be a bug. report it anyway and see what the devs say, im sure Noad will b along later today.