But Garry Curran, 44, lost again when police stopped the orange Ford Focus he was driving and seized the kilo of high-purity drug.
Curran, of 47 Househillmuir Road, Priesthill Glasgow, was jailed for 4½ years after pleading guilty to being concerned in the supply of cocaine.
At the High Court in Edinburgh, Judge Lord Burns was told Curran was stopped on June 1 by officers of the Scottish Crime and Drugs Enforcement Agency on the Glasgow-East Kilbride road at the Belle Craig roundabout in Eaglesham.
"I knew there was something dodgy in it," he told detectives who questioned him about the bag in the vehicle.
Experts said the 2½lbs (1.16 kilos) of cocaine, which had a purity of 72%, could fetch up to £576,000 if broken down into street deals.
Solicitor advocate Des Finnieston, defending, told how Curran, who has three children, had kept a £3000 gambling debt secret from his family.
He was approached outside a betting shop by men, said Mr Finnieston. "An offer was made to him of a way out of the particular financial strait he was in."