Yup, I too learned the hard way a few years back.
Always always make a backup save folder before any updates/patches or before you buy and download a new pack (it literally only takes a minute to copy the necessary folders over to a new location). And don't play any existing legacy type of game saves while waiting for mods/cc to get updated (just to be on the safe side).
Instead, create a new save and call it "vanilla gameplay" or whatever. Then you just simply keep that "vanilla" game save to play during those in-between times when you're waiting for mod updates. I usually just randomly play with some of the townies, or I build something, or whatever. It helps to pass the time during those handful of days it takes for some mods/cc to get updated before you get back into any main game saves you've been playing. It also gives you a chance to play the game in full vanilla mode, which can sometimes be helpful to determine if one or more of your mods are what's causing a particular glitch/bug in your game (instead of the automatic assumption that the glitch/bug is from the game itself).
I'm also now in the habit of doing a backup save once a month too, whether there's game patches/updates or not. I made a folder on my computer called "Sims 4 Backups" and every 3 or 4 weeks I copy/paste the folders needed to recoup all my hard work if the game chokes on me (Saves folder, Tray folder, Screenshots folder). I make a date specific subfolder inside that backup folder (ie: "Sims 4 Backup - March 2023") and place the copied folders in there (the date name helps to let me know which backup is which). I only keep the latest two backup subfolders (ie: March 2023 and Feb 2023) in that main backup folder directory, so I don't end up with a ton of unnecessary outdated copies taking up space on my computer.
Worst case scenario, my game chokes and I lose a few weeks worth of work/gameplay.... which is still better than having to start from scratch going back several years (been there, done that!).
If you always have those backup copies on hand, then you never have to worry about losing everything ever again. Stress free gaming. :)
Edit to add: Oh and I also make a Sims 4 backup copy of those same folders to a flash drive every few months (overwriting the old ones) just in case my computer crashes and dies (which can happen unexpectedly at any time).