Importance of Class Rank?

I’ve applied to all my schools for this year as I am graduating in June 2020, and although their obviously isn’t anything I can do about it now, I’m kind of curious as to the importance of class rank. I have a 1570 SAT and a 35 ACT, and my average in school is ~96 unweighted, ~98-99 weighted, yet I am 35/564 in my class. I don’t have any outlying bad grades, and I’ve gotten all A’s if not A+'s in my STEM classes, and I am intending to study engineering. I am in AP Calc BC, AP Physics C, and have 8 AP’s in total, along with the hardest possible classes for a schedule save a few. Though I am solidly in the to 10% of my class, I feel as though being in the top 10 is a big deal to colleges. Any insight as to whether or not my rank would hurt me at top 40 colleges?

Depends on the college, and whether your counselor used class rank when evaluating your overall academic strength on the school report.

98-99 of 100, and 6% of the class has a higher GPA?

It helps put your grades in context of the grading norms of your school. It reads to me that the school has a serious case of grade inflation, which I suspect admissions officers will consider.

Does your school even report rank? Many schools have moved to just reporting deciles. If you are in the top 10% of your class, that won’t be what keeps you out of any school.