basically you need to gather all the evidence to solve the mystery and then accuse the right person, that unlocks the path towards the good ending which includes the beast's maw stuff with brandon
If you want more in depth instruction on getting the good ending... follow the guide