For a while, Naruto hosted all the tailed beast and when they left him their powers should have stayed. When Gaara came back to life he lost Shukaku but he still had the power to control sand. Another example is when the Gold and Silver brothers were reincarnated they still had their powers just like the 7 Jinchuuriki that were reincarnated. So how did Naruto lose his powers?
I think you are misunderstanding the premise of the situation. Naruto was not a host of the other tailed beasts, he only had their chakra.
Naruto had also received chakra from the other tailed beasts during the Fourth Shinobi World War, which made him a human pillar for the power of Ten Tails. This allowed him to access their unique abilities himself, or infuse them into his Rasengan and its variants.
At the end of the Fourth Great Ninja War, Naruto still has the chakra of the Tailed Beasts within him
The tailed beasts spread out through the world, free to live as they want; both Gyūki and Kurama decide to return and stay with B and Naruto. However, though they are apart, the tailed beasts' chakra fragments remain within Naruto, allowing his body to act as their "meeting ground"
To expand on your examples, the Gold and Silver brothers ate the flesh of the 9-tails and inherited large chakra reserves and similar abilities to the tailed beasts. This become a part of their being, thus maintaining these powers when resurrected.
The brothers survived inside Kurama for two weeks by eating the beast's flesh; this would eventually lead to the fox regurgitating them. This left them with unusually large chakra-reserves and abilities similar to those of a jinchūriki.
As @Akira Mahisaseru stated, Gaara did not get his ability control sand by the 1-Tailed. Even the Fourth Kazekage wrongly assumed this
Gaara's ability to manipulate sand remains even after Shukaku is removed from his body. Indeed, the Fourth Kazekage, upon seeing how much sand Gaara can control at once, wrongly assumes it is Shukaku itself doing so, not Gaara.