It could be that there's a prophecy about Harry owning a planet. As he fulfills other parts of the prophecy in his life, this part about the planet also comes to pass. He might be led to the planet by a series of magical signs and symbols that only he can understand, and once there, he is recognized as the one meant to own it.
Perhaps he discovers the planet during one of his adventures. He could be using a new spell that accidentally transports him to this uncharted planet, and then through some series of events, he becomes the rightful owner. For example, he might save the planet from a great evil and as a reward, the planet's native beings make him the owner.
There's a possibility that after Sirius's death, Harry just sort of took over. He had already spent time there and knew the place well. The remaining members of the Order of the Phoenix, seeing his connection to the place and his leadership potential, supported his claim to Grimmauld Place.
Well, perhaps it's a planet with its own system of magic. It might have a core made of pure magic essence which gives power to all the magic on the planet. And there could be different regions, like one area filled with floating islands where powerful wizards live.
Perhaps he uncovers some major corruption or inefficiency in the Ministry. So, as a result of his efforts to reform it, he is given control. For example, if he finds that the Ministry has been misusing magic for personal gains, he could lead a movement to take it over and run it in a more just way.
He might have discovered the island during one of his adventures and claimed it as his own. Since there was no one else on the island at the time, and he was the first to set foot on it and recognize its potential, he decided to make it his property.
Maybe he inherits it. In the wizarding world, there could be some old family connections or a will that passes the ownership of the bank to him.
Well, in some fanfictions, Harry Potter might come to own the Ministry of Magic through his heroic deeds. He could have defeated a great evil that threatened the wizarding world so severely that the wizarding community decides he is the most fit to take over and reform the Ministry.
It could be a magical deal. There might be a spell or a magical contract that somehow transfers the ownership of Grunnings to Harry. This could be part of a larger plot where some magical entity wants Harry to have a connection to the muggle world through Grunnings for some grand purpose, like unifying the two worlds or preventing some dark magic from affecting the muggles.
In the fanfiction, it's possible that the castle was given to Harry by a powerful magical being. This being recognized Harry's pure heart and his need for a place of his own. Or perhaps Harry won it in a magical contest. He had to overcome many challenges and prove his worth, and as a result, he was granted ownership of the castle.
Well, in some fanfictions, it could be due to a powerful spell gone wrong that transfers the ownership to him. Maybe a spell meant to protect Diagon Alley's property rights backfires and suddenly Harry is the owner.
Harry may decide to have a more intuitive magic system. Instead of relying on wands, which can be lost or broken, the magical beings on his planet could use their minds and emotions to cast spells. The stronger the emotion or intention, the more powerful the spell. And to prevent misuse, there could be a natural balance in the planet's magic. If someone tries to use dark magic, the planet itself could resist and weaken the spell, teaching the user that dark magic is not welcome.