I can reproduce it by running Gmoccapy from LinuxCNC 2.10 with a pref file which is created by 2.9 or earlier, so it has lowercase names for "system_name_gxx" and so on. After that, entries like "system_name_G5x = G5x" are added additionally to the existent "system_name_g5x = G5x".
If you try to run that with 2.9, it gives the duplicate settings error.
Now come the weird thing: Gmoccapy from LinuxCNC 2.10 works with the duplicate settings because it only takes those ones with the capital letter.
Internally Gmoccapy works with the capital letter, so "system_name_G5x", "Gtk_theme" and so on.
In 2.9 the configparser does convert the settings name to lowercase and the same configparser on the same pc but in a 2.10 environment does not sonvert it and write the capital letter. I have really no idea why the configparser does now take capitals into account.
However I provided a fix here:
github.com/LinuxCNC/linuxcnc/pull/3181