That's horrendous. Yes maybe he could have gone about it differently instead of carrying the shotgun to the station and putting it on the counter. But surely they can't prove that the shotgun actually belonged to him? He doesn't actually own the shotgun, doesn't he?
I think this is horrendous and providing the story in the OP's link is true then I think it's a massive injustice. Imagine if you were in his position and completely helpless to defend yourself and guilty only because of a gaping hole in the law?
There isn't any gaping hole in the law. The law is that there is absolutely no justification for having an illegal firearm at any time. Ever. This makes it easier to prosecute people who are found to have these weapons.
I do really sympathise with the 'victim', but it really was quite foolish to do what he did.

You've found an ancient gun, which doesn't work, that used to belong to an old man.