It is because your code targets the IDs used in the original HTML.
But when you create a duplicate, your code apparently modifies the IDs. That's a good thing, because IDs must be unique within a document! The first duplicate then uses an ID of difetto2, so your code does not work!
Instead of using IDs, and going to a lot of trouble to alter them, just use CSS classes. CSS classes do not have to be unique.
In callbacks, use this to find the element that was clicked, keyup, etc. etc. and you can navigate the HTML from there if needed.