I have done exactly the same thing a lot of times. And I have never worked out the sort order. I have looked in the database were it is stored and it doesn't match anything I can find.
The bookmark/annotation handling has a few bugs. See
https://www.mobileread.com/forums/sho...39#post2494439 for details.
Because of the what you are seeing, I assume you are reading an epub that is in the main memory of the device. Most of the problems come down to the fact that for epubs in the main memory, the annotations are stored in two places; the database and a file. When you reopen an epub, the file is read and replaces the annotations in the database. This doesn't work properly.
The simplest workaround for most of these problems is to put the book on a micro SD card. For epubs on the SD card, the file for annotations is not created. Hence the annotations aren't messed up when the book is reopened. The sorting still gets messed up, but, the annotations are grouped within chapters so it isn't as bad.
Another way might be to use the extended driver in calibre to send the book to the device as kepub. I haven't played with annotations in kepubs to know if this works better.
As to complete loss of annotations, I don't know. There have been some reports here, but it hasn't happened to me. i have come back to the annotation list with the feeling that some were missing, but it hasn't happened often enough to find a pattern or even prove to myself that I only thought about adding the annotation.