How to stop Firefox from randomly messing up the order when adding a bookmark?

I have a bunch of folders in the “Bookmarks Toolbar”. Every day I drag and drop a number of tabs into one of these in order to create a bookmark for later reading/viewing.

For example, I might drag and drop a tab playing a YouTube video into my “YouTube” folder. Normally, as expected, the new bookmark puts itself in the bottom/end of the folder.

However, sometimes, it ignores its own programming and instead nonsensically puts the new bookmark somewhere in the middle of the existing items! Never in the top or even near the bottom, but in the middle. This causes frequent confusion and frustration.

I don’t understand how this is even technically possible, but Firefox and all modern software is full of this kind of nonsense. It happens inconsistently, seemingly randomly, without me doing anything differently between it working properly or “acting up” like this.

What could possibly be the cause?

I have also noticed that sometimes, it refuses to let me drag and drop the bookmark at all, but only to specific folders. I then have to either restart Firefox or put the bookmark elsewhere and then drag and drop it to its proper folder. This makes equally little sense to me.

Linux Debian 13. XFCE. X11. Firefox ESR.

Feels like it has started happening more frequently recently.