After 92617b7a758c0425330fba4b886296730567927c (https://github.com/bitcoin/bitcoin/pull/23306) we allow multiple entries in addrman with the same address that only differ by port.
Such peers.dat trips versions before the above commit and they fail to read it with an obscure "corruption" error:
Corrupt data. Consistency check failed with code -5
So, if we detect that there are such "duplicate" entries, write the file with a newver format version, so that old software emits:
Unsupported format of addrman database: 4. It is compatible with formats >=4, but the maximum supported by this version of Bitcoin Core is 3.