There is almost a novel here. A talented wicketkeeper from the southwest gets spotted by a big Colombo school in his teens. Goes on to lead that school to their best season ever. He quickly gets picked up by the national squad, and at first glimpse of this guy, the public is enchanted. He's organised, but there's also that manic fun of a schoolboy. He swings so hard at the ball his limbs could go flying off. By 23, he is Sri Lanka's T20I captain - their youngest ever.

So far, the Dinesh Chandimal story is a two-bit paperback.

Brace yourself, because here come the twists, the complications, the conflicts, the intrigue, and the nuance. Halfway through his first World T20 campaign, Chandimal is relieved of his captaincy is and ditched from the XI altogether, because he's not making runs. Officially he steps down voluntarily, but in actual fact, the team management and senior players put an apologetic arm around his shoulder and give him no real choice: "Let the big boys take it from here, Chandi." Sri Lanka would then go on to win that tournament.

In subsequent years, as a weakness against the bouncer reveals itself, and he gets haphazardly thrust into batting positions he is unsuited for, he is at one point pulled out of a Test squad mid-series and packed off overseas to play in a Sri Lanka A tour. Later he is told by a selector to go back to domestic cricket.

But the currents of Sri Lankan cricket are as fickle as they are volatile. They can pull you gasping into roiling waters, but just as abruptly they can wash you right ashore. So in mid-2017, long after he has traded his spirited schoolboy aggression for a dour, Test-match stubbornness, he gets handed the Test captaincy. At first it goes okay - a Test series win against Pakistan in the UAE, which no other team had accomplished in seven years. But then eventually, and perhaps through no major fault of Chandimal himself, the dangerous currents are at him again. There are series losses at home against England, and away against New Zealand and Australia. By mid-February this year, he has not only been dumped as captain, he has been axed from the Test squad entirely.

Of all the crazinesses of Sri Lanka's year, one of the strangest images is of Chandimal watching Sri Lanka's series in South Africa on television. He's their only batsman with more than 10 Test centuries. He averages over 40, when no one on that South Africa tour does. And yet, there he is at home, for the second time in his career, forced to watch a team he was just captain of surging to an all-time great triumph without him.

His year has been even stranger than the team's. For nine months, he didn't appear once for Sri Lanka, in any format. In August he was picked in the Test squad to play New Zealand, but was running drinks, not earning a place in the XI. On his return to Tests, in Rawalpindi, he got that unplayable ball of the match from Mohammad Abbas - one further kick in the gonads. Such has been his luck, it was almost a surprise the selectors didn't take the opportunity to drop him for his two-ball duck.

The 78 on Friday invoked so many pages of the Chandimal story. There was first the inflexibly defensive Chandimal circa 2016-2018, as he played out 14 run-less balls first up. Off his first 20 deliveries, he only had one run. Just when you began to be convinced this was going to be one of those Chandimal innings - like his 62 off 195 against Pakistan in Dubai, or his 27 off 83 against West Indies in Port of Spain, a sudden, rasping slash past gully off Shaheen Afridi, and then a flayed cover drive off Mohammad Abbas next over. Could this be a re-awakening of that other Chandimal, the one who once came into a hopeless match situation against India, in Galle, and smoked 162 off 169 - an innings of pure anarchy to turn the Test. It is difficult to believe not just that these two Chandimals can inhabit the same body, but that these two types of innings could be produced by the same species.

There were tussles with the short ball. The Chandimal of 2014 just yearning to unleash that wild and often fatal hook shot that saw him bounced the moment he came to the crease for at least a year of his career. There were pokes outside off stump, the kind he'd tried to iron out of his game with batting coach Marvan Atapattu all those years back. Like much of his career, Chandimal was doing just enough to survive without ever truly blossoming.

He'd scratch around, looking like any moment he would offer a nick to any one of the quicks. Then out of nowhere, one of those manic, hard-swung drives, like the disdainful, top-of-the-bounce shot through cover off Abbas that got him to fifty. A few overs later, against Naseem Shah, he reeled off three boundaries in five balls, through square leg, then point, then another one through cover. As with his career, the only thing that didn't bring him much trouble was spin.

For a Test side that has spent so much of 2019 looking completely out of their depth, and yet somehow repeatedly hauling themselves towards respectability, Chandimal's day-two innings was a near-perfect fit. Without him, Sri Lanka might have conceded a first-innings deficit. Thanks to him they have a decent chance. What the knock will personally mean for Chandimal - whether it will shore up his place, whether a second-innings failure will put him on the rocks again with the selectors, whether the selectors themselves get dumped and the new set promote Chandimal to a position of leadership yet - those chapters, in a wildly spiraling story, all that is yet to be written.

Andrew Fidel Fernando is ESPNcricinfo's Sri Lanka correspondent. @afidelf