A classic Argento plot

Sleepless
Non ho sonno
(2001)

The killer, past and present, is Giacomo's friend Lorenzo. As a boy he listened to writer Vincenzo De Fabritiis' nursery rhyme about killing animals and started killing women the same way. The murders stopped because Lorenzo's father sent him away, not because Vincenzo died.

Retired police chief Ulisse Moretti finally puts together most of the pieces but has a heart attack before he can find the killer's identity. Giacomo discovers that Leone, an old friend of Vincenzo's, is using a mechanical puppet that looks like Vincenzo to scare people involved with the original case. Giacomo follows Leone to his workshop, where Lorenzo's father is waiting for them. He kills Leone and wounds Giacomo, in an effort to cover up his son's crimes, but Lorenzo and Giacomo's girlfriend show up and Lorenzo's father kills himself instead. Giacomo figures out Lorenzo is the killer and accuses him. Lorenzo grabs Giacomo's girlfriend and holds a knife to her throat, backing up towards the window. The police arrive at the scene, having traced Lorenzo's phone calls to Leone, and shoot Lorenzo in the head through the window, killing him.

Thanks Tom G!