You haven't shown your input file, so I'm going to have to guess you have no trailers on that, and no headers.
You are not generating a header.
The SECTIONS processing is going to count all the records for that level of "break". You are generating a trailer record, with the count of the detail records. If you want to include the trailer record in the count of records on the trailer, you have to do what you have done.
So, no, in no way is the first detail record being considered a header. You have confused yourself by expecting that the trailer would be automatically counted.