I have experienced such behaviour when favouriting & unfavouriting courses: 1. I keep complete list of courses including favouitited ones in the courses list (i.e. keepfavourites is selected) 2. Favouriting a course copies it into the Favourites panel AND moves it to the bottom of the course List. 3. Unfavouriting the course remioves the star AND KEEPS that course at the bottom of the course list. I would expect the original position of the course to be remembered when it is favourited and restored when it is unfavourited. (Moodle 3.5.1 on Debian 9.4, MariaDB 10.1.26, PHP 7.0.30.0.9.1, Apache 2.4.25, Fordson theme with Boost presets.)