It was pointed out to me recently that this doesn't work right in later versions. The problem was I was using NMS to store the DN in the item itself so it could be restored later. That required adding new code every time a new version came out.
I know better methods now; 1.14 introduced the PersistentDataContainer. So I'm using NMS for 1.8 through 1.13, then PDC from 1.14 on. So it should conceivably continue to work as new versions come out unless they make some major changes.
Remove your old config.yml and let it generate a new one.