There are many incidents in this clip to analyze. You, as referees, need to analyze the entire clip to help you fine tune your game. We can learn from clips such as these.
The referee is in good position to see the original foul but when the ball is played forward the referee makes 2 mistakes: #1, the referee is flatfooted and does not anticipate: #2, the referee fails to look at the AR. Refereeing 101 tells us that on every through ball, the referee looks to the AR to see if there is a flag for offside. This did not happen in this situation.
Although the referee did apply advantage which was correct, it was incorrect due to the offside. This does not fall under a tactical foul as it does not break up a promising attack, but this is unsporting behavior, reckless tackle and must be a caution. The restart is a free kick at the spot of the original foul.
Referees must be prepared for quick counterattacks and punish infractions such as the one here.