Under VAR, the VAR would have looked at that foul in the box. They have to look at all situations where a penalty could have been called.
If they deemed the situation in the box a possible call that should be changed, they would alert the ref and the ref would look at the replay to see if their call should be changed.
The exact situation where VAR could be useful.
looks to me like the original foul was a shirt pull but in the box the defender comes around and bundles him over without getting anywhere near the ball. Second foul after advantage. Ref took the easy way out and went back to original foul.
https://youtu.be/F5bYLQbYv48?t=47s