When a device is syncing with a Shared iCloud Photos Library, you will see a switch to toggle between the Personal Photos Library, the Shared Library, or both libraries combined, when you browse the photos. This option is in the menu with the three dots in the upper right corner. Are you seeing these options?
Then your iPhone is signed into a Shared Library.
The iCloud Shared Library is enabled in the Settings > AppleID > Your Name > iCloud > Photos. Look at the toggle switch for "Shared iCloud Photos Library". Is it set to "ON"? If yes, you may want first to move the photos from the Shared iCloud Photos Library back to your personal library. Then turn off the Shared Library. Only the person who created the Shared Library can turn it off.
See: Leave iCloud Shared Photo Library – Apple Support (UK)
If you're the library creator, you can delete your Shared Library at any time.
On your iPhone or iPad
- Go to Settings > Photos, then tap Shared Library.
- Choose Delete Shared Library.
- Choose Keep Everything or Only Keep What I Contributed, then tap Delete Shared Library to confirm.
- All participants receive a notification.
- If the participant has been in the Shared Library for more than 7 days, all of the shared assets are automatically copied to their Personal Library.
- If they've been in the Shared Library for less than 7 days, only the photos and videos that they contributed are copied to their Personal Library.