Rai was on 16-under par going into the final hole and his 40ft putt looked to be heading in which would have seen him leapfrog joint leaders Tyrell Hatton and Ryan Fox and into top spot. Had it fallen in, it would have piled pressure on New Zealander Fox to complete a birdie to level at the top of the leaderboard.
However, the ball agonisingly lipped out – lifting pressure off Fox who rolled in from six feet win the championship, and collect a cheque for almost £1.25million
Former Wolverhampton Grammar School pupil Rai, from Perton, tapped in for birdie, to finish tied for second alongside Hatton.
They both collected prize money of £629,000 for the efforts.
Fox’s win capped a brilliant comeback after rising star Ludvig Aberg was brought down to earth having started the day in the lead.
Fox began the final round three shots behind leader Aberg and looked out of contention after running up a triple-bogey seven on the third, but covered his last 13 holes in eight under par for a closing 67.
Jon Rahm, who had been runner-up on each of his two previous appearances at Wentworth, carded an erratic 68 to claim fourth on 16 under as seven members of Europe’s Ryder Cup side packed the top 10, with Rory McIlroy surging through the field with a 65.
Aberg, who had been seeking back-to-back victories in just his 10th event as a professional, held a two-shot lead after 54 holes but slumped to a closing 76 which included two double bogeys in the space of three holes.
“I don’t really know what to think at the moment to be honest,” Fox said.
“It’s not a tournament that has treated me very well in the past, although I’ve loved coming here. I don’t know what changed today but it’s pretty special to make a birdie on the last to win.
“To have a back nine like that, especially after how I started the day, it’s amazing. I played great and pretty much didn’t miss a shot from the third hole onwards.”
Fox, who is the first New Zealander to win the title, added: “It’s such an iconic tournament. I know Michael Campbell won the World Match Play here and to add to that history with my family here to support me just made the week.
“We have been through a pretty tough year as a family. Lost my father-in-law in June after a really, really short battle with cancer and that kind of rocked the family.
“To have them here and have number two with us, little Margot who is four months old, is very, very special.”
Hatton, who won the title in 2020 when fans were absent due to Covid restrictions, said: “It’s definitely mixed emotions.
“This tournament means a lot to me. Would have been nice to win with fans, especially my dad being here, that would have been cool.
“Not sure I’ll even be disappointed with the tee shot on 15, it had started raining pretty heavy. It is what it is. Tried my best and it was a great week.”
Aberg, whose victory in the final qualifying event earned him a Ryder Cup wild card, admitted failing to close out victory would “sting for a long time”.
“This was the first time I was leading a tournament and I felt like I handled it quite well, to be honest,” the 23-year-old Swede said.
“It was quite difficult out there and I made a few stupid mistakes where I missed on the wrong side and was a little bit too cute with the chips.
“It cost me today and I’m trying to learn from it and I’m looking forward to the next time I’m in that same position.”
McIlroy was pleased to shoot 12 under par over the weekend after only making the cut with a birdie on the 18th on Friday evening, but disappointed not to birdie either the 17th or 18th to put more pressure on the leaders.
Defending champion Shane Lowry finished in a tie for 18th after running up a quadruple-bogey nine on the 17th in a closing 71.