Hello, Protagonist.
I'm not sure that your trouble is over. It looks like you're talking about Safari. There should be no problem putting bookmarks into folders in the Favorites Bar. Just to be sure, I just tried what I think you just described: Folders in Favorites Bar, BookMacster configured to sync and sort Safari, added a bookmark in Safari to one of the folders. Result: No problem: Bookmarks in the folder were sorted and nothing disappeared.
Such disappearance as you describe may be the work of a corrupted iCloud.
If the trouble recurs, let us know, and tell us whether or not iCloud : Safari syncing is switched on. That's in System Preferences > iCloud … there is a checkbox for "Safari". Do you have that on?
Also, regarding replacing the Bookmarks.plist file from a Time Machine backup – and this goes for everyone – don't do that if iCloud : Safari syncing is switched on. That can result in a big mess eventually.
We have a support page that explains
various safe ways of restoring bookmarks that were inadvertently exported over. As explained in there, all four of our apps in fact archive the Bookmarks.plist file (or equivalent files in other browsers) under the hood prior to every export. We call these
Sync Snapshots. By default, it saves 5 most recent snapshots, but you can set that number in Preferences > Syncing.
Again, I hope I'm wrong. I hope that your bookmarks are going to be just fine, but if not, let us know. Or if indeed you have been using iCloud : Safari as I suspect, read this
article on what causes and how to rebuild corrupt iCloud bookmarks.