I don't understand your choices completely or I'm missing part of the experience.
Why reinstalling your iPhone? We all know that iCloud is not the fastest Cloud option there is. Of course, after optimizing photo's it doesn't action immediately on storage. Takes a few hours. Not sure how long you gave your iPhone to sync with iCloud.
Overall; by using the download originals versus optimize, you could have triggered clearing a photo's download queue. Hope your system memory will remain at the few GBs you reported. If that's the case, we isolated your issue to some kind of iCloud-photo-download-stuck-drain-issue.
Let's remember; iCloud is not designed not intended to be used as an storage unit. Basically it's designed to perform as a multiple device Cloud server for continuity. Sure, you can have thousands of photo's on iCloud but Apple doesn't take responsibility for data loss. Apple's advice is to make sure you have back-ups yourself.
This even goes for iTunes purchases. Like Warner Bros did with Harry Potter. After Apple's announcement of 4K features, backwards compatibility and things like that, Warner removed the Harry Potter movies form the iTunes Store only to be re-releasing those in 4K. As a new purchase. Previous purchases weren't available for streaming, nor download. Back in the day, there we're a lot of complaints about that. Apple basically said you should've downloaded it on a device to make sure you can access your purchase and being able to stream. A purchase is not eternally available for streaming or downloading. I believe Warner's and Apple settled about this now and previous HD purchases are available again, not sure, I don't like Harry.
Further advice; through the years I came across multiple issues regarding iCloud services, especially after expanding iCloud storage. Now I only reset/restore through iCloud if I can have the device connected overnight and make sure iCloud can do it's job when I'm asleep. Never had a single issue again until this with the TV App which is or was clearly a bug.