Honestly the redoing the Gyms could really well tie into peoples theories surrounding Leon; Has never lost a battle, and is secretly evil, he sees you take on all the Gyms, defeat all the Elite Four, and so... with himself being the next target... He organises for all of your badges to be stolen, thus protecting his undefeated streak and title.
Could even see him being all like "I'd love to let you battle me for the title.. but the rules are the rules.. you need all 8 pieces within the key... Sorry."
Then comes the subsequent, and I'd assume relatively quick, 8 gym battles to recover all of your pieces and a final, shock encounter with Leon who finally, both, loses the match and loses his cool.