Help me identify this movie

Here’s what I remember:

I saw it on TV around 1960, so it’s at least about 50 years old.

The star of the film/protagonist is about 20 years old. In the course of committing a burglary he is attacked and kills his attacker in “self defense.” He clearly wasn’t intending to kill anyone. He is convicted of murder and sentenced to die, which is I think what happens at the end of the film.

I know little about old films so I don’t know if this is a classic that I’ve heard mentioned frequently or so obscure that even the surviving actors don’t remember it.

If anyone remembers the film I’d be interested in finding out the name and seeing it again from an adult’s perspective.

Perhaps this one. If I had A Million

Plot: A dying millionaire decides that his family is worthless and doesn’t deserve to inherit his fortune. So instead he picks 8 random strangers from the phone book to each get a million. 8 stories follow, of how this affects the various recipients. One of them is a young man about to be executed in circumstances very similar to the one you describe. One of the other seven segments stars W.C. Fields