For sure enabling shared albums takes up local space on both macOS and iOS.
Apple does save space and download lower resolution / lower fidelity thumb nails, and the quality is generally quite good so not everyone notices that you are saving space when you allow iOS to download and save space from iCloud pictures.
You wouldn't be able to know if you have phantom photos unless you remove the iCloud from your settings - that will sync up any data and then remove all local copies - leaving all your iCloud photos intact.
Then you can re-measure and/or restore the entire OS on the iPhone and be sure it's super clean. I've not seen the system report photos when they aren't visible in the app, but it could happen. I have seen "free space" get low when some data goes "missing" and a restore has always cleaned that up for me - as has erase all content and settings on iOS.