Those stats only work if 1kg of freight earns the airline the same as 1kg of passenger which it clearly doesn't.
That 20t of freight you carried is worth about £20k to BA. The 176 extra passengers the 380 carried will be paying a tiny bit more than that. The 44 extra club seats alone would be conservatively worth £160k. The 380 still carried some cargo too!
It's a niche for sure, but a very profitable one on the right routes.