The Pokémon's anime has some fairly dark moments, few are as twisted as Ash's trip to a disturbing alternate world.
In both the games and the anime, the incursion of mysterious, powerful Pokémon known as Ultra Beasts is one of the biggest problems facing the Alola region. Ultra Beasts come from other dimensions, including both their own unique worlds and alternate versions of the basic Pokémon world. The anime takes this story arc directly from the Ultra Sun and Ultra Moon games, where Guzzlord is discovered in a destroyed version of Alola's Hau'oli City. While that's left to environmental storytelling in the games, the anime decided to confront Ash with the destroyed remnants of the area that had been his home for nearly a hundred episodes at that point.
Ash Visits a Post-Apocalyptic Version of Pokémon's Alola Region
In the episodes "Battling the Beast Within!" and "Parallel Friendships!", Ash asks Tapu Koko to do battle with him for practice, which ends up opening a rift in space-time when a different Tapu Koko in another dimension performs the same attack in the same spot. Ash and Pikachu are sucked in, left without his bag, other Pokémon, or even his Pokédex. Ash wakes up, only to find that everything around him is gone, and only debris remains. They stumble into the Guzzlord responsible and are only barely saved by a trainer named Dia, who's paired with Zeraora. Dia leads Ash to a safe spot in the ruined city, past a lot of familiar buildings, including the Trainer School where he has spent the past few months with all his friends, which is also in ruins. Ash is a bit disturbed by all of this, but Dia explains the concept of alternate worlds. Ash works with the reluctant Dia, and together they're able to send Guzzlord off through an Ultra Wormhole, ending the crisis in this version of reality. Ash himself is returned to his original Alola by the Tapu Koko of this universe.
The storyline is pretty wild, and definitely a darker turn than the Sun & Moon anime's lighter, sillier style would suggest. This episode serves more of a purpose than just a one-off adventure, though; when multiple Guzzlord later emerge into Ash's Alola after the Alola League Tournament, both Ash and the viewers instantly know the threat that they pose. Ash also has some insight into how Guzzlord behaves, though, which gives the main cast an advantage in dealing with the Guzzlord and helps to prevent the same thing from happening again.
While it seems a bit out of left field given the usual tone of the Pokémon series at that point, the post-apocalyptic Alola story provided both an interesting look at how bad things could get and the foundation for its big finale.