Search your local OneDrive folder for "copy" to find any that got renamed as a duplicate. If you have file names with your computer name in them then apply the Microsoft credentials fix before you do any deletes
There's Microsoft Q&A discussion about OneDrive duplicates in Microsoft Q&A. It suggests to go to C:\Users\username\OneDrive and search for "copy" in the search box. This only shows the files that are synced to this PC. It's possible a file with "copy" in the file name is an edit you want to keep. Another type is a file with your computer name appended. Microsoft support page about duplicate files in OneDrive starts with this exact scenario: if you have a file that is duplicated in your OneDrive with your computer name appended to the filename then it might be time to refresh your credentials. Their solution is to remove the saved credentials for OneDrive in Credential Manager, restart OneDrive. Maybe you'll need to reinstall. Remove the copies first and you might end up with new copies popping up all the time.
After fixing make sure you've got photos on this PC. Run Get-FileHash or a duplicate finder on the OneDrive Pictures folder. Only delete from one place, let it sync for a few minutes before checking it in the web version.
Free and full version
The free version is not a demo with hidden results. It scans, groups and marks everything it finds, then stops after 15 deletions per session.
Find and delete duplicate photos on Windows 10 and 11 with File Explorer, PowerShell, OneDrive search or a duplicate finder, and keep every original safe.
If you have a large library the fastest is a dedicated finder. One scan to group your copies, the extras are pre-marked. If you only have one folder with a few dozen duplicates then File Explorer size sort will be faster than installing a program.
Free and solid for exact copies: PowerShell. For resized and burst, get a duplicate finder that includes perceptual matching, a side-by-side preview, deletion to the Recycle Bin, and support for your RAW and HEIC.
Use Photos or File Explorer to look around, create albums. Use a duplicate finder to clean up. Throw away duplicates first, then you only need to sort each picture once as you organize.
User on Microsoft Tech Community says it won't delete what they selected. There's a Level1Techs reply with a "permission denied" error warning. Try it on a copy of a folder first. If it continues to fail, try something else.