Centuries ago, the power of Hoopa was sealed inside the Prison Bottle after it ran wild and threatened to spiral out of control. In the present, Ash Ketchum, Rica Matsumoto and his friends Pikachu, Ikue Otani, along with Serena, Mayuki Makiguchi, are pulled through a portal created by Hoopa's interdimensional rings to Dahara City. The moment they land, Hoopa Rie Kugimiya tries to use its rings again to transport everyone to the nearby Dahara Tower, but in this altered state Hoopa cannot travel through the rings it conjures.
Baraz, the great-grandson of the man who sealed Hoopa away and one of Hoopa’s caretakers, arrives with the Prison Bottle. The bottle possesses Baraz and compels him to release a shadow of Hoopa born from the anger of a hundred years of confinement. Hoopa’s power is reclaimed by the bottle, but the danger isn’t over yet. Team Rocket makes a bold bid to steal the bottle; when Meowth lays hands on it, he becomes possessed and the bottle is opened, unleashing Hoopa’s power once more. Hoopa struggles to control the unleashed force, but Hoopa’s shadow emerges as a separate Pokémon, determined to overpower the real Hoopa.
In the ensuing chaos, the Prison Bottle explodes, and Hoopa calls upon Lugia to help, distracting the shadow just long enough for Hoopa to slip away. Baraz and his sister Meray realize they can forge a new Prison Bottle at Dahara Tower, drawing on the ancient powers of earth, fire, and water. They decide to use Serena’s Braixen, Ash’s Frogadier, and a wild Hippopotas from the desert as catalysts for the new bindings.
Meanwhile, Lugia’s duel with Hoopa’s shadow shifts as Lugia is tricked into flying through a ring, returning to its ocean home. Hoopa answers by summoning Latias, Latios, and Rayquaza, and Ash, Hoopa, and Pikachu ride atop Latias and Latios while Rayquaza joins the fray to battle the shadow. Ash commands the group to assault the threat, but Hoopa’s shadow retaliates by summoning six more Legendary Pokémon, escalating the danger.
Back at the tower, the team works tirelessly to reforge the Prison Bottle, weaving the powers of fire, earth, and water into a new container. Rayquaza unleashes a protective twister around Dahara Tower to shield the work, while those inside push ahead with the reassembly. The shadow and the Legendary Pokémon still press their assault, testing the limits of the new bottle’s power.
The struggle reaches a critical moment when Baraz drops the nearly finished bottle, and Ash narrowly catches it, only to become possessed again. Hoopa then taps into its own memories of happiness to cleanse the shadow from within, banishing the evil with the strength of its cheerful recollections. Yet the sheer number of Legendary Pokémon summoned creates a space-time warp around the tower, threatening to tear the scene apart.
Arceus intervenes, stopping the warp with its immense power and granting Hoopa one more chance to escape. Remembering the warnings and tender ties from Baraz and Meray’s great grandfather, Hoopa recognizes the bond it has formed with Baraz and Meray and chooses to stay with them for the moment. With Hoopa’s powers no longer fueled by anger, it finally finds a way to travel through the ring.
In the emotional denouement, Hoopa decides to stay with Baraz and Meray’s family, intent on rebuilding the city before returning to its homeland in the Arche Valley. The city begins to heal, and Hoopa’s journey to freedom becomes a step toward a brighter future for everyone involved.