If the Soldier has completed basic training, AIT, and is assigned to a regular unit then Yes they can be flagged for failing the APFT or HT/WT standards.
The specifics references can be found in AR 350-1, AR 600-9, and AR 600-8-2
G-9m(10)(a) Soldiers in basic combat training must attain 50 points on each event or a score as determined by HQDA, DCS, G–3/5/7, in coordination with TRADOC. (This exception does not apply to AIT, OSUT).
G-9m(6) Soldiers who fail a record APFT for the first time or fail to take a record APFT within the required period will be flagged in accordance with AR 600–8–2. In the event of a record test failure, commanders may allow Soldiers to retake the test as soon as the Soldier and the commander feel the Soldier is ready. Soldiers without a medical profile will be retested no later than 90 days following the initial APFT failure. Reserve component Soldiers not on active duty and without a medical profile will be tested no later than 180 days following the initial APFT failure.
3-2a. Soldiers are required to meet the prescribed body fat standard, as indicated in appendix B. Soldiers will be screened every 6 months, at a minimum, to ensure compliance with this regulation.
3-2e. Soldiers identified as exceeding the body fat standard will be flagged in accordance with AR 600–8–2 and enrolled in the ABCP. They must meet the body fat standard in this regulation in order to be released from the program.
2-3b. “Army Physical Fitness Test failure” (Flag code J). Initiate a Flag when a Soldier fails a record APFT or when, through the Soldier’s fault as determined by the commander, the Soldier fails to take the APFT within the time prescribed by existing regulations, or when directed by the commanding officer (as provided for in AR 350–1). A Flag is not required for a Soldier who has a permanent or temporary profile that precludes taking the APFT or is unable to undergo an APFT because of conditions beyond the Soldier’s control (as determined by the commander). Soldiers with a profile effective after the APFT will remain flagged until a record APFT is passed. A Flag is not required when the commander determines the Soldier cannot be administered an alternate APFT because of conditions beyond the Soldier’s control. Soldiers who become pregnant after being flagged for failing an APFT (as determined by a physician) will remain flagged until successfully passing an APFT. Remove the Flag (code E) on date of compliance.
If, as determined by her primary care provider, the Soldier was pregnant at the time of APFT failure, the commander will immediately remove the Flag (code Z).
2-3c. “Noncompliance with Army Body Composition Program” (Flag code K). The effective date of the Flag is the date that the Soldier was found to be in noncompliance with AR 600–9. The use of certain medication to treat an underlying medical disorder or the inability to perform all aerobic events may contribute to weight gain but are not considered sufficient justification for noncompliance with AR 600–9 and the Soldier will be flagged. Soldiers will not be exempt because of chronic medical conditions unless an exception to enrollment in the ABCP is granted by the DCS, G–1. In the case of a pregnant Soldier, if the Soldier became pregnant prior to being entered into the ABCP, the commander will close the Flag using codes KZ, not KE. If the Flag was initiated before pregnancy (as determined by her primary care provider) the Flag will remain in effect until the Soldier complies with AR 600–9. Remove the Flag
(code E) on date of compliance.