In terms of games I didn't like with music I love, two franchises come to mind:
Sonic the Hedgehog - I've always hated the gameplay for this series, even the classics. But man, do they have some bops. The classics had some of the best original scores I've ever heard, and even the games with featured tracks fit so well with the game as well as the characters, and on their own were catchy and fun.
Final Fantasy - Unlike Sonic, I wouldn't say I HATE the gameplay, but I've definitely never cared for the random, grindy encounter system it had as well as for other games, but this series in particular is what drove me away from it to begin with, so it's significant enough to mention while also pointing at any others in its general direction. That being said, while it's not my style of game to play, I always find myself coming back to the soundtrack. In fact, my favorite track of all time from video games comes from Final Fantasy VI: Dancing Mad. That and a handful of others holds a firm place in my heart and listening to them almost makes me wanna play them, but alas, even if it comes to that, I realize it's just the music, not the game.
On the other hand, we have a subject that's actually pretty tricky for me, considering what I came to realize about games in general: The better the soundtrack, the more memorable a game is to me. So chances are if I enjoyed a game whose soundtrack wasn't good, I might not have even remembered enjoying it unless it was brought up somehow. So if something happens to come up that fits here, I'll edit the post to include it below.