It all started off with a normal, slightly mad sacrifice:
Black decided to create attacking chances, so he played 8 . . . Bxh3?
And White found a solution that ended everything:
I take it you set the puzzle up wrong? I also don't see how you got the second position from the first.
He obviously played 0-Ng5-0.
Black to play and get mated after blundering certainly is an unussual solution to a common tactic.
Nevermind, he must have played N...h6-0-g5-0.
Oops. Yes, White was castled.