I could not find anything stating you have to be counseled specifically for an APFT failure prior to attending school. However when you fail an APFT you should be counseled in accordance with AR 600-8-2 within 2 working days of the flag being initiated. So at a minimum you should have been counseled for the initiation of the flag.
To specifically address your question ATP 6-22.1 para 1-6 simply states the counseling should occur as close as possible to the event.
Based on my research there is no specific time frame or requirement to counsel you for the APFT failure. In my experience this requirement is usually a local policy
I have provided references below for your review.
3-13b. Physical readiness and height and weight requirements for military institutional training
Soldiers flagged for Army Physical Fitness Test (APFT) failure or body fat composition will not be selected, scheduled, or attend institutional training. Once Soldiers meet standards, they will be considered eligible for military schools and institutional training courses.
Unless otherwise specified in this regulation, only commanding officers, commandants, an officer/civilian with specific authority to sign “For the Commander” (for example, BN or higher executive officer, deputy commander, or adjutant), or HQDA general officer principle staff heads or their designee may authenticate a DA Form 268. Failure to counsel within prescribed times does not invalidate the Flag. The Commander, HRC (AHRC–PDV–PS) will authenticate adverse action DA Forms 268 or investigation DA Forms 268 initiated by HQDA.
The flagging authority, unit commander, or first line supervisor will counsel all Soldiers on active duty, in writing, upon initiation of any Flag within 2 working days unless notification would compromise an ongoing investigation. Soldiers not on active duty will be counseled regarding initiation of a Flag prior to the conclusion of the first training period following the date the Flag was initiated. Counseling should include reason for the Flag, requirement for Flag removal, and action prohibited by the Flag. All flagged Soldiers will be provided a copy of the DA Form 268 when the Flag is initiated and when it is removed. Notifications for HQDA initiated flags may be delayed to protect against the unintentional early release of a promotion board’s results.
1-6. Specific Instances of Superior or Substandard PerformanceOften counseling is tied to specific instances of superior or substandard duty performance. The leaderuses the counseling session to convey to the subordinate whether or not the performance met the standard and what the subordinate did right or wrong. Successful counseling for specific performance occurs as close to the event as possible. Leaders should counsel subordinates for exceptional as well as substandard duty performance.