Flatpak shares libraries, so there are no duplicates of the same version, though there may be duplicates of other versions, as that would ensure compatibility with the specific app.
App image does not share libraries between apps, so it would potentially have more duplicates.
if it’s not in my distro or I can’t compile it withing my distro’s packages, I’m not installing it. I don’t want the same library in ten versions.
Flatpak shares libraries, so there are no duplicates of the same version, though there may be duplicates of other versions, as that would ensure compatibility with the specific app.
App image does not share libraries between apps, so it would potentially have more duplicates.