Lachlan Irvine, 44, was being sentenced in the Dunedin District Court yesterday on 30 charges when the flashpoint occurred.
The defendant was repeatedly warned by Judge Michael Turner for communicating with his partner in the public gallery during the hearing.
Finally, the judge asked for the partner to leave to "stop the distraction".
Irvine’s expletive-laden response resulted in him being sent down to the cells.
"W....., f... you. Scumbag mother......," he yelled.
The sentencing was reconvened later in the afternoon and Irvine was jailed for two years and four months.
The court heard how his crime spree began in January last year, selling a non-existent game console on an online marketplace.
Irvine said last year his life unravelled with the breakdown of his relationship.
He told Probation he met up with old associates and began using drugs again.
"This is him falling off the wagon, so to speak, in a very big way," counsel Brendan Stephenson said.
The 20 shoplifting charges to which he pleaded guilty were a "reaction to poverty and a call for help", Irvine said.
But the judge rejected that explanation.
"You stole wine, but the top-class wine.
And you seemed to have a particular taste for champagne."
On July 1, Irvine selected eight bottles of wine, worth $1019, at New World Centre City, put them in his backpack and walked out.
The next day he stole seven bottles of champagne, totaling $701, from New World Mosgiel and Gardens New World in North East Valley in the same fashion.
It was not all high-end products though. On occasion, he would pocket a $2 bag of lollies.
He also swiped electronics, toys, books, tools, cosmetics, flowers and perfume worth more than $12,000.
But an AI loss-prevention platform used by supermarkets nominated Irvine for thefts totalling at least $50,000.
Judge Turner highlighted the defendant’s extensive criminal history which had resulted in him spending 14 years in prison.
The 16 pages of Irvine’s record comprised a huge variety of offences.
The judge mentioned: dishonesty, burglary, theft, using a document, receiving, drug matters, violence, robbery, resisting police, driving crimes, breaching court sentences, impersonating police and failing to answer bail.
Irvine owed $18,000 in reparation for his previous crimes.
Alongside his prison term he was also banned from driving for a year and a day.