Matthew Davies donned a pillow case to carry out the armed raid on a branch of the Bank of Scotland but found the disguise hindered his sight.
His counsel Lorraine Glancy said: "When he was in the bank in order to be able to see the person he was trying to rob he required to expose his face not only to that person but to the CCTV cameras operational in the bank."
Miss Glancy told the High Court in Edinburgh: "The robbery charge is one that is completely outwith his normal character and one that, when looked at objectively, was unlikely ever to go successfully."
Davies ,47, had pulled a meat cleaver from the pillow slip and then put the bedding item on to cover his face.
But he then had to quickly remove it. Prosecutor Stewart Ronnie earlier told the court: "This was due to a failure to create eye holes."
Davies did manage to rob an employee of the bank in Bothwell Street, Dunfermline, in Fife, of pounds 1980 after brandishing the weapon and demanding cash.
He told a teller on September 23 last year: "Give me the money. I am f---ing warning you." He was initially given about pounds 300 but demanded more money.
He motioned towards a female customer and warned: "I don't want to f---ing hurt her." Davies repeatedly struck a glass partition with the cleaver.
A man going into the bank decided to follow Davies as he made his escape and tailed him to the street where he stayed.
The witness described him as walking slowly away from the robbery and at one point stopping to pat a dog.
Police found cash and a pillowcase like that used in the raid along with a stun gun at the address in Reid Street, in Dunfermline.
Davies, a prisoner in Glenochil jail, earlier admitted the assault and robbery and a charge under the firearms act.
Miss Glancy told the court that for much of his life Davies was "a pro social member of society".
But his marriage foundered and he ran into financial problems. A successful tree surgeon business, in which he was a director, also hit difficulties.
Miss Glancy said his mental health deteriorated and he began to use crack cocaine.
The defence counsel said that Davies committed the bank robbery "not particularly to gain any financial advantage but in an effort to bring to an end his continuing drug use".
She said: "He saw prison as an alternative to the situation he found himself in."
She said: "It was an ill conceived plan by him and a poorly executed one, standing the circumstances of the robbery."
The defence counsel said that since being in custody following his arrest he has been drug free.
The judge, Lord Turnbull, told Davies that he would have faced a six year prison sentence for the robbery but for his guilty plea.