You could make the school vastly more entertaining by making it forbidden to wander at night, requiring stealth, and by making classes an actual activity you can engage in via mini games. Like others have said, Bully is the perfect blueprint.
Acing your classes in Bully also gave you tangible benefits in the form of special items or combat techniques. I would say nix the talent system entirely and let all of your perk upgrades come from doing your classes.
I think also one of the major reasons they funnel you out of the school so often is because there's no good way to engage with combat on the grounds of Hogwarts. And admittedly the game's combat system is a lot of fun, so I wouldn't want the open world cut down entirely.
The game really needs a writing overhaul. The only character with a quest line I would consider remotely well written is Sebastian. He's the closest thing to a friend it feels like you can have. It helps that he has a story with personal stakes that also effects several other characters around him, including the player.
Poppy has a fun enough quest line about saving magic animals, which is okay, but Natsai is fucking awful and there isn't even a Ravenclaw rep.