If only the world championships ended as well as it started for the swimmers from Down Under.

The much-vaunted Australian squad had an impressive but controversial beginning on the opening day of the swimming program — an upset win by 18-year-old Ariarne Titmus over three-time 400-meter freestyle champion American Kate Ledecky.

Then there was a high-profile shunning by Mack Horton of his 400-meter freestyle opponent Sun Yang.

Horton, angry that swimming's world governing body allowed Sun to compete at the world championships before his Court of Arbitration for Sport hearing into a clash with drug testers, refused to stand on the podium after finishing second to the Chinese star.

Horton was roundly criticized in China, but was given a standing ovation by fellow swimmers when he returned to the dining hall later that night at the athletes' village.

Sprint ahead to the final weekend at Gwangju, South Korea, where Australia was on its way to completing a meet total of five gold, nine silver and five bronze medals — second only to the United States' 27 in total, 14 gold. Suddenly, the Aussie team was tainted by a doping case of its own — and, it seems, not a single person on the team knew.

Don't throw stones

People who live in glass houses ... well, a lot of people in Australia could have finished the rest of that sentence.

Shayna Jack's A and B doping samples tested positive for Ligandrol, a banned substance which the 20-year-old swimmer said can be found in supplements. But it's often a drug that body builders use to increase muscle mass.

Swimming Australia was on the back foot through most of the episode.

Jack continues to deny any knowledge of how the banned substance came to be in her system. The A sample results were given to her on July 12, the B sample on July 19, only two days before the swimming events began at the world titles. Jack had already been sent home from a pre-meet training camp, with Swimming Australia saying her departure was for personal reasons.

WATCH | Australia's Titmus upsets Katie Ledecky for 400 free gold:

The 18-year-old from Australia edged 14-time world champion Katie Ledecky of the USA to capture gold in the women's 400m freestyle. 5:08

That means her B sample was returned to her eight days before her failed test became public, news which directly contradicted statements made by Swimming Australia chief executive Leigh Russell after the doping story broke.

And on the Saturday night, shortly after it emerged that Jack had tested positive in an out-of-competition test in late June, Swimming Australia refused to let head coach Jacco Verhaeren appear before the media. That forced swimmer Cate Campbell to answer some uncomfortable questions she should never have been made to answer.

Russell faced the media Sunday and said Swimming Australia did not divulge the positive test because the B sample had not been received, and that it had an agreement with the Australian Sports Anti-Doping Authority not to release doping positives until both samples had been received.

Tired excuse

Former ASADA head Richard Ings disagreed. "If Swimming Australia are suggesting that their anti-doping policy forbids them from announcing the Jack provisional suspension, they are wrong," Ings said on Twitter. "The explanation that 'I have no idea where it came from and I'd never take anything intentionally' unfortunately is the excuse used in every one of these cases."

Russell said she was "distressed" to see Horton make his podium protest while being unaware of Jack's positive test.

But the bungling by Swimming Australia brought back memories of just six years ago when a damning independent report was released following the swim team's poor performance at the 2012 London Olympics, its worst since the 1992 Games in Barcelona.

The report released in 2013, and commissioned after allegations of some swimmers using a drug called Stillnox to help them sleep, highlighted a "toxic" culture including drunkenness, misusing prescription drugs, breaking curfews and bullying; and a lack of discipline, accountability, transparency and communication.

If Swimming Australia still has a few issues among those points to improve on, at least they have a year before the Tokyo Olympics to do so. Australia will go in as the United States' biggest threat in many of the individual races and relays in the Olympic pool.

"While an Australian athlete returning an adverse result is both bitterly disappointing and embarrassing to our team, our sport and our country, it does not in any way change the zero tolerance view that Swimming Australia has and our continuing fight for a clean sport," Russell said.

Only time will tell if that's the case. And if Swimming Australia is able to better handle the situation if there is a next time.