The team isn't designed to live forever -- it either wins by picking off everything Shedinja can't counter, setting up with Mega Gyarados, or counter-sweeping with Ditto. This usually involves making a few trades, so don't bend over backwards preserving everything. The team can deal with pretty much every relevant threat in the meta one way or another, so if this gets another go at OMOTM before the next rotation, I encourage you to give it a whirl.
Shedinja counters miscellaneous threats that might otherwise make a fat team balk, like Zygarde, Mega Lopunny, Clefable, Tapu Koko, Xurkitree, and Magearna. A Swords Dance set doesn't turn Shedinja into a powerful mon, but that kind of damage output is necessary to keep it from being too passive. Secret Power is chosen as the main attack because it's Sheddy's only move that doesn't make contact, meaning that it can click its link without fear of Rocky Helmet users coming in on the switch, and it doesn't need Protective Pads so Focus Sash becomes available.
Tapu Fini is one of two defoggers, and it has the benefit of setting up Misty Terrain to ease the matchup vs. status users, especially Heatran. Its defensive typing is very fortuitous for its matchup vs. a lot of threats. Surf + Moonblast actually 2HKOs most of the meta outside of fat steels, and Taunt lets it actually turn the tide on hazard setters. It doesn't live long enough to make use of Leftovers, so Iapapa Berry lets it take an extra hit or two as a surprise, which is incredibly useful. I'm very surprised that I didn't see it on other teams, since its utility goes far beyond supporting Shedinja.
Klefki exists mostly as an emergency Defogger that can get one off vs most of the meta, in a pinch. Getting off one sacrificial Defog to let Shedinja come back in has won the game for me multiple times. It uses a Thunder Wave + Swagger as an additional emergency measure -- while screens are popular on Klefki, I prefer to use it as a way to minimize the opponent's chances of attacking or setting up Trick Room. It can't do much to Dark-types, but Tapu Fini counters most of them anyways, so they make a good team.
Ditto is Ditto. With setup being as strong as it is in this meta, and Shedinja sometimes being unavailable, the team can't expect to counter every sweeper on its own merits, so Scarf Ditto is there to patch up any holes. It doesn't serve to dissuade the opponent from setting up, since they often can't avoid it, which is honestly just as good.
Heatran patches up the team's susceptibility to Electric-types with Fire coverage, Psychic spam, and powerful Grass-types. Chople Berry lets it function as the best Psychic and Bulu check it can, assisted by Flash Cannon; Lava Plume is just a spammable move to link with it. You won't get a burn if Misty Terrain is up, but it's still definitely worth it. Rocks are good sometimes but not worth it if you want to Defog. Last slot is free so do whatever.
Mega Gyarados defensively checks a lot of the same stuff Tapu Fini does, so if the opponent overloads Fini, it can often come in right afterwards. But more importantly, it's an incredibly deadly sweeper that can either prey on weakened teams to clean up or force the opponent to use up things that might otherwise check Shedinja. Pre-Mega, it's also a Ground immunity that's more expendable than Shedinja. It has Moxie over Intimidate even though it almost always Mega-Evos right away, because otherwise Bisharp is a pain.