With the latest batch of EX Raid Battle invites, we implemented a few changes to improve Trainer and Gym selection. Unfortunately, a bug was introduced when these changes were made, and, as a result, some Trainers were invited to participate in an EX Raid Battle at a Gym they may not have visited in several months. This bug has already been resolved, and future invites will better represent how the updated invitation process is intended to function. Most importantly, Trainers will only receive an invitation if they’ve completed a Raid Battle at that Gym recently.
We’ve also made a couple changes that will impact the invitation process. First, we’ve made changes to the ways Gyms are selected. While EX Raid Battles will continue to take place in parks and at sponsored locations, the number of Gyms that meet the necessary criteria for an EX Raid Battle will increase. Additionally, the average number of Trainers invited per Gym will also rise, as we’ve made a few tweaks to the way they are selected. Thanks to these two changes, more Trainers will have the opportunity to engage with the EX Raid Battle feature.
Source: Pokémon GO