Some high schools require that a student be registered in the AP class in order to reserve a seat for the May tests.
Based on my time at the local high school: Tests are paid through the cashier’s office and “ordered/reserved” in advance, in the Fall.
The staff know exactly how many students are registered for the May testing. (They have to logistically plan for all of the students’ whereabouts during the May testing and continue to educate everyone else who is at the high school.)
This includes district supervised home-schooled students and private school students within the district who have been assigned to the public high school site by the District and College Board.
Sometimes it is hard for students who are not enrolled in the course to access a “seat”.
The proctors are strict about test “access codes” because of the possibility of “cheating” or taking extra time.
Before you try to self study, you need to ask if your high school will allow you to take the test on site if you are not enrolled.