In the live televised draw on Thursday, trainer Clive Cox was cut off when trying to tell his representative which stall to choose.
As a result, Cox missed his allotted time slot and and was given the last stall, number 15.
Despite that alleged handicap, he came home a head in front of Barney McGrew, drawn six, with top-weight Knot In Wood running yet another admirable race in third.
For Dettori, it filled in a gap on an otherwise illustrious CV.
“Clive was very confident, the ground had dried up and the rest is history,” said the Italian.
“He has run tremendous races all season and I am ecstatic, it is like winning a Group One race.”
Cox said: “It is very special, he has always promised to be a good horse and it has all come right.
“We could not believe a week ago that the ground would dry up for him, but the good Lord looked after us.
Dettori completed a 34.5-1 double when be brought the Saeed bin Suroor-trained Prince Siegfried (11-8 favourite) home an easy winner of the Listed Doonside Cup, being followed home by his stable companion Baila Me.
The rest of the meeting was dominated by Richard Fahey, with the Malton handler saddling an incredible eight winners at the three-day affair, winning the Bronze and Silver Cups with Baldemar and Kaldoun Kingdom, both ridden by 5lb claimer Barry McHugh.
Distinctive recorded a shock 33-1 success in the Group Three Laundry Cottage Stud Firth of Forth Stakes at Ayr to leave trainer Bryan Smart with Classic dreams.
Smart, who trains her for owner/breeders Lesley and Gary Middlebrook, said: “She will stay (a mile) and we will have to run her in one of the Guineas trials in the spring.”
Kieren Fallon clocked up another notable achievement since his comeback by partnering Strike The Deal to victory in the Group Three Dubai Duty Free World Trophy.
The pair had struck up a good partnership when winning at the St Leger meeting and trainer Jeremy Noseda was keen to keep the partnership together.
Noseda said: “Going back to five furlongs has been helpful but so has Kieren - he just has this ability to get him to go to sleep and to come with the late run.
“You have to strike while the iron is hot with sprinters so we might look at the Diadem next week. He must have fast ground.”
Mark Johnston’s Awzaan is set for the Shadwell Middle Park Stakes in a fortnight after proving a cut above in the Dubai Duty Free Mill Reef Stakes.
Owner Sheikh Hamdan Al Maktoum’s racing manager Angus Gold said: “Sheikh Hamdan wanted him to have a break after the Newmarket July meeting and the only worry was how much weight he had put on.
“We’re thrilled he’s three from three and I should think he’ll go for the Middle Park now. We have tried to win both races before but that was with horses who have been on the go, while this one is fresh.”
Brian Meehan’s Radiohead looked the winner a furlong out but faded to finish fourth.