Have you tried a smart album with the rule "Photo is unable to upload"?
try to find all items, that are neither photos nor videos, for example audio files.
Use smart albums to weed out files with a suspicious format. This can be done by searching with a smart album to search for the filename extensions. An example is here:
How to Weed out Legacy Media in Photos for Mac - Apple Community
Which system version do you have installed? If you are now using macOS 10.15 Catalina, Photos is no longer able to work with PDF files - you should also remove all videos and image files that can no longer be opened by Preview or QuickTime Player. I have removed all videos with a codec that is neither HEVC nor H.264, all images with the filename extension PICT or BMP.
You can also try to look at the caches inside the Photos Library package, but be very careful, when you try that and do not modify anything.
How to check, which Items are currently being uploaded - Apple Community