I just checked - my iCloud Photos Library on my Mac is empty, no photos and videos at all because I deleted them, but in iCloud are still 300GB, and at www.icloud.com in the Photos.app all my photos have been saved, all items I have had in my library, when I first set up the Shared iCloud Photos Library.
See: How to use iCloud Shared Photo Library – Apple Support (UK)
"When you join a Shared Library, iCloud captures a one-time snapshot of your photo library database and associated metadata and stores it for up to six months. This helps with a smooth transition of your content to Shared Photo Library. Any photos that were in your library at the time of the snapshot that are subsequently deleted will also be stored in iCloud for up to six months".
There seems to be no way to free the cloud storage for Photos quickly, after we set up a Shared iCloud Photos Library for the first six months after joining the shared library.