The issue is exactly as you have guessed. This was an issue that I believed I had fixed at the start of February, but it seems that I made a mistake. There is code to filter out duplicates from the world, which will run whenever the save file's "modversion" does not match the value in the installed mod. Edit: the duplicates in the mansion will not be removed, but they will be given unique IDs.
The following code can be added below the last line of exploration.gd that you quoted. It should start with the same number of tabs as the as the quoted code. Note that you will need to use a decent text editor and replace the leading spaces with tabs as the forums automatically replaces them. If you change the mod file, then you will need to re-apply the mod; if you change the program file, then you are all set.
text = "$name observes you... #add after this line for i in globals.state.allnpcs.duplicate(): if str(rewardslave.id) == str(i.id): globals.state.allnpcs.erase(i) break