Alastair Fenwick, 63, was due to go on trial in connec
tion with the weapon but the case against him had to be dropped.
The Crown admitted failing to frame the charge properly and deserted the case against Mr Fenwick when the mistake was drawn to their attention.
After an investigation lasting more than a year and costing thousands of pounds, Mr Fenwick was cleared.
Mr Fenwick, of Invergowrie, Perth and Kinross, had been charged with breaching customs and excise laws by fraudulently evading the prohibition on importing stun guns.
He was accused of carrying out the offence at Mount Pleasant Sorting office in London, but due to no Perth and Kinross location being detailed in the charge, it was deemed incompetent to hear it in Perth Sheriff Court.