In my high school, we had what was called a “zero hour”, and it was something available for juniors and seniors (or, in rare cases, sophomores).
With approval from a guidance counselor and if you were well on track to graduate, a student could dual enroll, or take classes at the local community college (be it online or in-person courses) and potentially have credits from the courses transfer with you to college.
They had it set up where the list of classes we could chose from would be evening courses, therefore fall outside of school hours. So, rather than make a student take 6 courses during the day plus the extra college course, that student could choose to drop any period during the day.
For example, I dual enrolled my senior year, both semesters. I chose to drop first period both semesters (because I wanted to sleep in lol), so I didn’t roll up to school until second period. I knew of other people who made zero hour their last period so they got to leave school early, or after lunch so they had an extended break… really just depended on your schedule/which high school class you were willing to drop.
There was also an odd case one year where the juniors/seniors specifically in AP Statistics all received a zero hour. The teacher of the course was coach for girls basketball and had some sort of schedule conflict, so they spoke with the school board and stuck a deal with their students (it was a very small class so everyone agreed) to attend the class before school hours and in exchange get a free hour during the afternoon, the original slot which the class was scheduled.
So yeah, it’s defintely possible but depends on the area. If it matters, my school was fairly small/rural and not very competitive.