As explained in this answer, you are mixing together two separate events. It's a common mistake, the movies aren't entirely clear about it, but they do make a distinction between:
- Being the Black Panther
- Being the King of Wakanda.
If you pay attention to T'Challa's dialogue to Natasha in Civil War, you'll hear him say something like "I have been a warrior for my people, and now with my father's death I am also king."
The title/mantle of Black Panther is not automatically held by the King of Wakanda. They are frequently the same person, and being King apparently entitles one to become the Black Panther, but in the prequel comics (linked in my other answer), we see that T'Chaka voluntarily steps down and passes that title on to T'Challa nearly a decade before his death, roughly at the same time that Tony Stark is revealing his identity in Iron Man. T'Challa had been the Black Panther for a long while by the time he became King, which is why they have a specific step in the ritual to take away that power.