Even a bad high school class gives more preparation than no high school class. My D took AP chem with a brand new teacher (veteran had a medical crisis and couldn’t return at the last minute). Teacher was beyond unprepared. The students routinely pointed out her errors in both lecturers and on exams. The kids formed study groups, reached out to recent alumni for tutoring, and advocated for themselves with the admins (she was fired after the school year. Icing on the cake for the administration was when most of the class bombed the AP test).
My D (a chem E major in college) retook chem 1 and 2 because she felt she didn’t have a strong enough foundation and it turns out that she knew way more than she thought. She was the curve breaker on every exam (got a personalized letter from the prof at the end of the year, was asked to be a TA, etc…). And she probably learned more in self advocacy and utilizing her resources from that AP class than any others. Those skills have served here well. The realities of life is that there will always be bad teachers, bad team mates, and bad bosses. The key is learning to be successful despite them.