An unspoken rule in movies dictates that the best and most popular characters shouldn't die, or they should at least die dramatically at the end. Not only did some movies defy this truism by killing a well-known character or even the protagonist, but by going as far as killing these characters the moment the movie began.
Source:https://www.cbr.com/movies-best-characters-died-beginning/