I remember an extremely similar scenario,,,
It was the Adventures of Foreman Scotty
of the Circle-4 Ranch,,,
The writers for the Foreman Scotty show must have seen the same movie you did..
He was a local TV Hero (Channel 4 - Oklahoma City),,,
He had an afternoon show where local kids sat in the gallery.
In one of his adventures through the "Time Tunnel" on the ranch,,,
He was being held in a prison and used the same technique,,,
The cartridge was placed in a hole in the barred door,,,
He hit it with a rock and a nail from his boots,,,
Bad guy down - Foreman Scotty escapes,,,
I was maybe 9 or 10 when I saw that episode in the early 60's,,,
The only thing that kept me from trying it,,,
Was fear of the "Wrath of Mom!
Today they would jail Foreman Scotty for reckless endangerment.