Bagnaia was forced to work his way through the pack from 16th on the grid, but was able to leap up to the fifth at the pitstop at the end of lap five when rain started to fall – though he was hit with a double long-lap penalty for speeding in pitlane, along with Ducati teammate Jack Miller.
The Italian went on to finish fourth to only drop one point behind Yamaha’s Fabio Quartararo at the top of the championship.
However, he revealed the rain proved fortunate for him as the bike he started on wasn’t working properly.
“I had the luck to change the bike because the first one was not working very well,” he said.
“So, a bit of luck in this crazy race. I’m happy because I finished fourth with these two long laps.
“I just entered [into pitlane] 3km/h more than normal and it’s correct that they give me this penalty.
“But my pace was really strong. On Friday I was telling my team that in any case I was preferring medium tyres and today this choice worked well because my pace in the end was very strong, I was recovering a lot of seconds to the leaders.
“We managed to do a good race, last year in the wet I was struggling more.
“So, I’m happy about that. We just need to check on the data what happened with the bike that I used all weekend on the dry because after the race I started struggling a lot with that bike.
“So, we need to check the data for the next race.
“But we can be happy about today. I’m second in the championship and just one point behind Fabio.”
Petrucci boosted by season-best result
Last year’s Le Mans winner Danilo Petrucci enjoyed his best race on the Tech 3 KTM last Sunday after recovering from 17th on the grid to fifth.
Having made a “reset” after a disappointing Friday after going the wrong direction with set-up, Petrucci feels a slightly wetter race could have netted him another Le Mans podium.
“We certainly made a good reset on Friday, because the direction we had taken didn’t work,” he said.
“There was a meeting where I had my say on what could be improved and actually something changed immediately.