Currently, TemplateHandler sits at the first step in stage 2, however, it returns tokens processed to the end of stage 2 and those pass through the stage a second time.
Ideally, it would return tokens processed to the end of stage 1 but there seems to some subsequent handlers that depend on the pipeline options that are presented when it processes to the end of stage 2 (ie. inTemplate)
See https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/631523 for complications that arose.