Something which such unknown and new concept like mega evolution allows to be done perfectly tying into new life path Gary choosed to follow and way to learn more himself, gather new knowledge about whole process behind pokemon experiencing such power boost informing other scientists and professors from other regions with discoveries he made. While utilizing his acquired knowledge and skills as battler through Blastoise or some other pokemon leading toward their mega evolution getting from first hand insight in whole process and secrets through his own pokemon along with playing vital role in story be it by battling Team Flare, Ash or contributing to story in some other way.
I certauinly don' see anything wrong in Ash and friends story clashing sometime bumping into each other, rekindling friendship, meet new companions and go in same direction gathering new experience, forming new friendships and developing their stories.
Regardless of all new characters we get, there is no reason in my opinion to forget about previous ones like Gary in this case and do more with those you started your work about coming back when their presence could help push things forward while gaining benefit themselves through it.
There is no justification to erase them forever like they never existed, because that way your only damaging series reputation and credibility instead of making it appealing to all kind of fans making people happy of their favorites not being abandoned enjoying in their personalities, pokemon and new stuff made with them.
For instance i felt with May we didn't got enough fleshing as we could never seeing her develop her own contest style stepping out from Ash shadow having unfinished business with rivals, room left to improve as coordinator which could lead her toward top coordinator title etc.
With Misty her water master career was unexplored, so was her admiration toward Lorelei, there was left more to be done with pokemon team and skills as trainer learning to use them in most optimal way(like weakness to electruc, psyduck etc), explore on backstory, her fears, flaws and what motivated her in wanting to become water master . Ending unfinished with lot more left to be done.
Gary may have matured, but he is by anime standards relatively green character having more to offer and learn as person, develop his skills as reseasrcher and build his own reputation and glory as Oak grandson. He certainly isn't something i would call as character used to its full potential if you ask me.
He is still present within same continuity and universe with connection to prof. Oak always making him relevant to series to some degree. Especially as Ash childhood friend playing important role in main protagonist history along with posession of pokermon which can mega evolve giving him again marketing value to become relevant and promote something.
I have nothing against sequels personally , as long they're executed in believable and proper manner.
No one story in this show was concluded anyway persay having unfulfilled dreams and ambitions, they were just replaced with some quickly made plotline to have them send of the cast and make room for whatever number of new characters were gonna get following repetitive, never ending cycle.