"St. Leonard is the patron of prisoners, prisoners of war, locksmiths, and miners." -- https://ucatholic.com/saints/leonard/

The story speaks of saint Leonard's worm and saint Leonard's wood.

I'm curious, is this statue of saint Leonard?

The worm is from 1400 years ago, And "Saint Leonard was born to the Frankish nobility in the 5th century.". So the timelines appears okay.

Just my thought,
Robert