His best-known role was as Dumbledore in the “Harry Potter” franchise