After sentencing, Hannay said it wasn't quite the Lord of the Rings fantasy portrayed in court, but simply that he found himself in a field and came across a hut.
He said: "It was like one in the morning and I was wasted and I was walking across a dark field. I didn't know it was in a school."
When he flicked the light switch on inside the garage he clicked to what he was doing and jumped out of the window and headed home, he said.
Defence counsel Philip Jensen said it was not a "normal type of burglary" and that Hannay had co-operated fully with the police.
"I don't think anyone's making any dispute of the explanation as to how he got himself into that situation. He has taken responsibility for his actions that evening and pleaded guilty at an early opportunity," Mr Jensen said.
Judge Heather Simpson sentenced Hannay to 120 hours' community work.
Despite his "fanciful idea" of what was going on, she said it followed a common pattern of burglary while under the influence of a substance.
Ms Pyke said she found out about the incident when police called. "I'm not condoning it, I have no excuses, nor would I, for what he's done," she said.
"He's a 22-year-old, he does know better. There was no question I tore strips off him. I told him, 'You're on your own with this one'."