But the 27-year-olds Hartley and Bamber were already celebrating as Bernhard brought the car home behind the leading Toyota, even though it had been a tough day as both Porsche 919 Hybrids were a lap down after four hours of the race.
Jose-Maria Lopez led from pole position but lost the lead in the opening 30 minutes after contact with the the car of G Drive Racing Oreca.
Buemi took the lead after passing the No1 Porsche team, with Nick Tandy behind the wheel.
Tandy slowed with a technical issue, which he cleared with an electronic reset of the car, but the British driver lost over a minute in the process.
Bamber moved up Porsche up to second place behind Buemi, who was holding a comfortable lead.
Lopez's recovered Toyota then moved back up to second and by the half way point of the race the Toyotas were running 1-2 with a 15 second advantage, with Hartley driving the Porsche a distant third, with even more time lost when the front bodywork had to be changed during a routine pitstop.
The collision opened the door for the Buemi, Davidson and Nakajima crew, but even being a lap down, Porsche knew the title was theirs.
The motoring giant has now won the FIA manufacturer's title three years in a row, while Palmerston North's Hartley has back-to-back world driver's titles in what is proving a brilliant season after securing a Formula 1 drive with the Scuderia Toro Rosso team.
And for Bamber, nothing could have been sweeter.
"It's been a fantastic season and I couldn't wish for anyone better in the car like Timo and Brendon," he said.
"They have been fantastic all year and everyone at the factory has worked so hard.
"When we brought the new high downforce package in it was a real turning point for us this season.
"To do it here at Shanghai at a track I started my career with Porsche is pretty special."
Close friend Hartley agreed.
"It hasn't fully sunk in yet as it has been quite a busy few weeks for me.
"But to share a second title with Timo and a first one with Earl, who I grew up racing with, is an incredible story."
Bernhard said it was an honour to race with the two young Kiwis.
"It is definitely the peak of motorsport I have achieved.
"It has been an incredible season we have had and you have seen what we have achieved here.
"To have the winning streak we had [four race wins] I think was amazing and today we just have to accept that P2 was the maximum we could do."
The German said it will be an emotional final event in Bahrain, as Porsche will not run an endurance programme next year.
Back home, the confirmation of the world title was a great source of pride for local motoring enthusiast Lyndsay Tait, who along with Avon McDonald set up the Wheels Trust for local businesses to give financial support to the young Bamber, some 19 years ago.
"It was pretty much sort of expected, just the way it was going to round out. It's a great occasion."
Nonetheless, even though Toyota only really had a mathematical chance of staying in the hunt in Shanghai, Tait agreed anything could have happened.
"Especially in motor racing, all it takes is one 10 cent part failing."
The trust gave support to Bamber for some 8-10 years in his formative days trying to get on the world stage, where he would claim multiple victories and rookie awards as he branched out into Asia and eventually Europe.
"Initially, we knew he was talented, he was 12," said Tait.
"We knew we had an exceptional talent because of his results on the world stage in the junior classes.
"We always we were up against it, monetary wise.
"It's the personality, his conduct, ability to development, relate to the car and the engineering team."
In his late teens, Bamber would win a round of the 2009 World A1 Grand Prix in Holland in his first drive for the New Zealand team.
He won back-to-back Porsche Carrera Cup drivers championships in 2013-14, before becoming a test driver for the manufacturer and twice winning Le Mans - in 2015 and this year.