Hi
Are the duplicates a different format (eg HEIC and JPG)? If so, then most likely when you have transferred from your phone previously, the phones HEIC images have been converted to jpg (Phone Photos settings - transfer to Mac or PC set to automatic rather than keep originals), while iCloud will have transferred the original HEIC.
If this is the case then you should be able to identify all the iPhone jpg images using a smart album, check that all those images also exist in HEIC format, and just delete the jpg versions. Get back if you want help with this.
Alternatively, using an app designed to work with the photos library (Ie one that marks the photos or puts them in an album, and lets you review and then delete them, rather than doing the delete itself.
Do NOT use a general file duplicate finder not designed to work with the photos library. They will damage your photos library and likely cause loss of your photos.
I personally use PowerPhotos (I also use this for copying images and data between libraries)
https://www.fatcatsoftware.com/powerphotos/
Another suitable app recommended by experts here is PhotoSweeper (I have no personal experience of this one)
https://overmacs.com/
Both are paid apps. PhotoSweeper is the lowest cost and can recognise duplicates based on content, but PowerPhotos provides a lot of functionality in addition to the duplicate detection.