Thank you for the additional screenshots. Did you specifically notice the sorting issue immediately following your upgrade to Codebook for Android 3.1.0, or following a synchronization with another instance of Codebook? We have not modified any of the sorting routines since we introduced the favorites feature previously, however that does explain what you are seeing.
You mention that you are able to fix the sorting of the incorrect items by editing them, or toggling their favorite star. Does the incorrect sorting return or do they stay corrected? We will continue to try replicating this behavior locally, but haven’t been able to as of yet.
If I may ask, what device and Android OS version are you running? Is your device rooted?