There is no significant character named Robert in the Harry Potter series. You are likely thinking of Remus Lupin.
Remus Lupin—beloved Defense Against the Dark Arts professor, Marauder, and father—dies during the Battle of Hogwarts (alongside his wife Nymphadora Tonks).