Duplicate distances can sometimes occur when:
You accidentally submitted the same distance twice.
Two apps you're connected to both send us the same distance. It's best to disconnect one of the apps, e.g. Strava or Google Fit.
You're completing two or more challenges at the same time and you accidentally post a distance to the wrong challenge.
In some circumstances you want to connect different devices, if this is the case then you can use posting preferences to make sure your distances aren't duplicated.
Posting Preferences are individual to each challenge you are on. This enables you to do things like 1 swimming challenge and 1 step challenge at the same time. You may have a device you use for swimming which also detect step, but you have another device that you are already using to count your steps for the step challenge. In this scenario you can use posting preferences to make sure the right distances connect to the right challenge.
Things can become a little bit more complicated when we take a look at Apple Health (and the new Android equivalent Health Connect), where this app can also receive data from multiple other apps, like Fitbit, Strava and Garmin. Therefore with Apple Health we can also isolate the source of the data.