Yes, Hogwarts Legacy has multiple endings. There's a good ending, a bad ending, and a more universal ending. And you will reach that true ending if you continue playing after the immediate threat is averted.