The legendary fruit of Elbaph is ...

the Gomu Gomu no Mi, the same one eaten by Luffy.

14 years ago, King Harald pushed trading with other countries. He set up trades with the World Government, hence why there's a summoning circle in the throne room, and the Elbaph treasure room is completely empty. He gave the WG everything ... for who knows what in return (Elbaph joins the WG?)

One of the final things he gave them was Elpah's most prized possession, the Hito Hito no Mi, Model: Nika. Loki learned of the "trade" too late to stop it, prompting a fight and eventually ending in Harald's death. In order to cover for Harald's crimes, Loki claims to have eaten the fruit, while in reality, he has no fruit or an unrelated one. This is Loki's character; he lies and claims responsibility for disasters, so people have someone to blame. All the things Hajrudin said Loki did as a kid are driven by this.

13 years ago, after Harald gave the fruit to the WG, they transported it by a ship with Who's Who, and it was stolen by the Red Hair Pirates, and the rest is history.

In the future, the revelation that Luffy has the legendary fruit exonerates Loki.

Why? It tells the full story of Hito Hito no Mi, Model: Nika, Luffy finally realizes what he has, and puts Loki on the good guys side, plus a large semi-comedic misunderstanding with Loki seems Oda's style.

This concludes my cooking.

Edited to add: Okay brief followup dessert cook, what if the fight 6 years ago between Loki and Shanks was because Loki learned the Red Hair Pirates got the fruit, and demanded they return it. Shanks would never tell him about Luffy, and if Loki threatened to hunt down Luffy, maybe that's why he ended up on the tree. And this conflict is why Loki hates Shanks so much.