NFHS 9-6-1 (paraphrased): Team A/K cannot go out of bounds and return to the field of play unless blocked out by an opponent.
I want to imagine three scenarios here...
Scenario 1: Receiver A12 is running a deep route down the sideline, without a team B player in sight. As he is running his route, he accidentally has one foot land out of bounds. A few steps later, he catches the ball in stride and runs in to the end zone untouched.
Scenario 2: Receiver A12 is running a deep route down the sideline, without a team B player in sight. As he is running his route, he accidentally has one foot land out of bounds. A few steps later, he catches the ball in stride, but his first step with the ball in his control is out of bounds.
Scenario 3: Receiver A12 is running a deep route down the sideline, without a team B player in sight. As he is running his route, he accidentally has one foot land out of bounds. A few steps later, he catches the ball in stride, and immediately runs out of bounds after possessing the catch in bounds.
In scenario 1, it seems you have no choice but to throw a flag for illegal participation in order to wipe team A's touchdown off the board. In scenario 2, do you still throw a flag? It seems excessive to penalize a team 15 yards for this accident, seeing as how the play results an incompletion. What about scenario 3?