honestly, i prefer it when it's course based. some might argue that sandbox based games are better because the levels are bigger and have more exploration, and i can respect opinions like that, but i think the games being level based allow for more level variety. don't get me wrong, i really like sandbox based games, i loved mario 64, but eventually visiting the same world over and over looking for collectibles gets tiring and you wanna go somewhere else. granted, that's the point of different worlds in sandbox based games, but you get something new very quickly in course based games. Mario galaxy tho is kind of a weird case where it's both level based and sandbox based. you have the small levels with about one star that you quickly forget about, but you also have the big worlds where you can explore, such as honeyhive galaxy and seaslide galaxy, which feel like they belong in games like sunshine or 64. that's kinda why i love galaxy so much: it gives you short levels if you don't feel like exploring or it gives you big levels if you wanna look for stars.
so yeah i prefer course based games, but sandbox based games are very close to being better.