Goldie rarely leaves the track without a winner, but even he could not have hoped for a result such as this.
He looked like claiming the spoils with Goninodaethat, who was having his 53rd outing at Ayr, but he was nailed close home by a mare who was winning for the first time.
The 11-2 chance prevailed by a head with Insurplus third and Sea Of Green fourth.
"I've had the first three before, but it's the first time I've ever done four, I know that," said Goldie.
"To be honest, though, I wasn't too surprised as I knew they were all going there in good form.
"I thought the conditions were perfect for Goninodaethat but also that he'd be setting it up for the closers.
"When he took two lengths out of them I turned away as I thought it was job done, but then I saw Cheeni closing.
"It's good for her as that's her first win. It was a great ride by PJ (McDonald), he's a talented horseman."
While Goldie's achievement is rare, he has to go some to match Michael Dickinson's 'Famous Five' in the 1983 Cheltenham Gold Cup, while Aidan O'Brien managed the first three in last season's Prix de l'Arc de Triomphe and Qipco 1000 Guineas.
There was another notable achievement on the card when the Ontoawinner Syndicate registered their 100th winner through Cosy Club (16-1) in the QTS Ladies Night On 12 August Handicap.
Trained by Adrian Keatley in Ireland, it was a first success for the pairing.
The syndicate, who celebrated Group One glory last season with Quiet Reflection, has only been going for six years.
"He had some good form early on, but had lost his way a little. His last race was a non event, but he was back on it today," said Steve Bedforth, syndicate manager.
"Adrian is our only Irish trainer and that's a first win for Ontoawinner Ireland, even though it was in Scotland!
"We picked Adrian because he's a young trainer, forward thinking and with great ideas.
"It's so difficult over in Ireland, it's so competitive, so Adrian brings his over quite a lot.
"We've been on 99 winners a while now and every day I've had a press release ready to go and was changing the name!
"We've only been going six years, so to have 100 winners in that time is some achievement.
"Obviously Quiet Reflection has been the highlight, but we've won the Mill Reef (Toocoolforschool) as well and we've some nice youngsters coming through like Raydiance who just needs soft ground.
"Being in a syndicate is just a more intelligent way of ownership. If you've got £40,000 to invest rather than putting it into one horse spread it about a bit, you're guaranteed to have more fun."
Graham Lee rode a double with Crazy Tornado (11-2) and Maulesden May (16-1), while Richard Fahey's Regulator (4-5 favourite) looked a youngster with a future when winning the opening novice stakes.