I have almost the same issue. My setup is what Apple would advise on how to use Photos within their ecosystem:
1) I put all, full resolution, photos in the OSX Photos app on my desktop. Because I have many holiday and birthday albums I created a few folders for those same occasions and dropped those albums in there. I turned on iCloud Photo Library on my desktop (took many days to upload and I needed a 200GB storage plan on iCloud but now see all photos on www.icloud.com/#photos)
2) On my iPad and iPhone I enabled iCloud Photo Library, but due to low storage available I set it to 'Optimise iPhone/iPad Storage'.
One day the folders where the Birthday and Holiday albums reside in are gone, similar to what you're experiencing. Which means the albums are also gone. At least, that's what one would think, but the Albums, and the photos within, are still there. They're still there on your iPhone, iPad, and Photos on the Mac. You can check this by searching for them, simply enter (part of the) Album name and the results will show those missing Albums and photos. You won't be able to see them in a web browser on iCloud.com because there is no search option there.
I *think* the reason for the disappearing folders is that with the synching between iCloud <> Photos on the Mac <> Photos on iOS is that if you rename a folder on the Mac it vanishes from iCloud and iOS. Possibly because you cannot create a folder on there.
The frustrating thing is that we cannot handpick what to restore; Photos on the Mac is just one large container and can only restore that whole thing. But doing so won’t ‘magically replace’ your Folder structure (or your entire photo collection) on iCloud. Nope, a restored Photos DB on the Mac won’t sync over the changes, it merely picks up from the last sync.
So, my dreamed up solution is going to be quite an exercise, which I hope will work:
1. Backup everything. All photos, may they be on your Mac, iCloud Photostream, on an iOS device - back them all up. Check that backup, browse through the photos, making sure you really have everything
2. On iOS, turn off iCloud Photo Library. It should delete the majority of photos, possibly leaving some in the ‘Camera Roll’. I think I’ll connect it to Image Capture on the Mac and hand delete the last bit.
3. On the Mac, open the Photos app, in Preferences, tick *off* iCloud Photo Library which should prompt me if I want to delete all my photos. Say yes to that.
4. Delete ~/Picture/Photos Library.photoslibrary on the Mac
5. Check that there aren’t any photos left on www.icloud.com/#photos
6. Check there are no funky cruft left in a bin somewhere, now that we are seeing more and more “files in the bin will be deleted after 30 days”.
7. Create a new Photo library on the Mac, importing photos from backup. I may decide not to use Folders anymore, though that will result in an extreme long list of Albums.
8. Have it all upload to iCloud by checking the option in the preferences
9. Enable iCloud Photo Library on iOS. My old iPad isn’t big enough for full resolution so I’ll use the ‘Optimise iPhone/iPad Storage’ option. On new 256GB iPhone I’ll store Full Resolution of the photos because I don’t like to wait for the photos to download while showing an Album to a friend.
I may need to block a weekend for all this to do. And the uploading will be a pain. So will the downloading be, as the software isn’t looking if your device is on the same LAN; it can only download from iCloud. Which is rather disingenuous because I could simply hook up my iOS device to the Mac with a cable. But I digress: Apple thinks all their users have high-speed Internet. And that isn't the case.