The principle is very simple: Net trades are opened and closed so that the sum of the net lots is at any time identical to the sum of the phantom lots. Of course all trades close at the current price, not at entry price.
Your observation has two reasons. You expect that virtual hedging generates the same profit as real hedging. This is not the case. The profit will be different due to the different number and duration of trades. There is also a second effect that you can see in your example, and that I've added to the manual for clarification:
Simulation of virtual hedging in [Test] mode is not 100% accurate when trades open or close inside a bar (f.i. pending trades). Because intrabar simulation handles any trade separately from all other trades (see TMF remarks), the order of opening or closing net trades will be different than in real trading. This can cause a slightly pessimistic simulation. This restriction does not apply to trades that open and close at bar boundaries, i.e. by script commands.