Hi, thank you for asking your question! I agree with @Tana's answer because they recognize the importance of the larger profile. Just one bad grade in an advanced level course is not going to ruin your chances at an Ivy League. However, consistently underperforming in advanced classes in your area-of-interest classes will penalize you in the applications process.
I am also reading some comments regarding GPA in the comments so I can address this as well. For many Ivy leagues and selective universities, we recommend having at least a 3.75+ unweighted to be a competitive applicant. This means at least a 3.7 in AP/IB HL, 3.85 in Honors/IB SL, and 4.0 in College Prep level classes.