iCloud Sync deleted all photos on my iPhone
This might be a bit long, but I'm having a very specific and weird problem.
I've been short on storage for a long time (128GB iPhone 13) and now wanted to make sure all was synced to my iCloud that was previously 50GB. I upgraded to the 200GB plan and tried to back up my phone, it took quite long but I think it backed up. Afterwards when iCloud was syncing with my iPhone, I expected it to upload my phone photos to iCloud but it started flooding my phone with media from my old devices or even random deleted long footage from long ago. I was already on the high 120s, and it overflowed my storage to the point where my iPhone wouldn't turn on anymore, it would just keep spinning and restarting.
I got my phone to open once and turned off sync to stop this, and that's when every single media on my phone just disappeared, most of which were not on iCloud (I'm using iCloud on Chrome on Windows). After I deleted every app I own to make some storage and turned Sync back on, they started to reappear one by one, but stopped when it got to around 10k when i originally had around 25k. Now it says "Restoring from iCloud..." in the Photos app, but I found that random dates are missing and are on iCloud while sometimes whole months in between are fully gone from both.
Just for clarity all I wanted was to make sure everything on my iPhone was backed up to iCloud.
This is very strange and I'm sorry for the long paragraph, I just hope someone can help me slightly.
Please ask for me to clarify if necessary since this is undoubtedly very confusing.
iPhone 13