The 60-year-old man, whose name was not reported, walked into a bank in Hiddenhausen with a loaded nine-millimeter pistol and demanded nearly $65,000, The Local.de reported Saturday.
The only teller working at the time informed the man that she could not open the safe and the would-be robber reduced his demand to $13,000, the report said.
He then fled the bank in fear that the teller would call the police. He turned himself in two days later.
Judge Georg Zimmerman, who presided over the man's case, called the crime "an act of desperation" adding the motive of helping his granddaughter was an honorable one.
The man's granddaughter was born with a heart defect and has undergone several operations, which the family's health insurance only partially covers.
The defendant was placed on probation for two years.
"Go home and look after your family," Zimmerman told him.
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'