I worked this out and I have mentioned it before in the autoinvest feedback.
It’s because you may have bought shares in a company, then also bought some in a pie. Then when you sell the shares manually, it uses the average price of both manually purchased and pie purchased shares, to work out the new return on investment. Whereas when you look at the investment from the pie, it only shows the return from those shares that the pie bought.
That might be a terrible explanation but it’s what’s causing the problem. If the Trading212 team needs me to explain again the I will try! My link is below and I provided a few screenshots which should be useful.