As a backup, make a copy of the photos that are in iCloud that are from your Mac.
Archive or make copies of your iCloud data.
Then go to System Preferences/iCloud (Apple ID for Catalina) and turn off Photos syncing. If asked if you want to save the photos, choose Yes. Then go to Photos/Preferences/iCloud and turn off iCloud syncing.
Then go to iCloud.com/Photos using a computer browser and delete the photos that are in iCloud that are from your Mac. Once you have them deleted, then find the Recently Deleted album, and delete the photos from there.
Check the Photos application to see if you are missing any photos. If so, import them from the backup. Once you are sure you have all the photos in the Photos application, you can delete the backup if desired.