The Ten-Tails consumed an Ōtsutsuki and became the god Tree, which produced a chakra fruit. Kaguya ate that fruit, gaining its power. She then passed part of this chakra/chakra type to her sons, Hagoromo and Hamura, both of whom could use TSO. Much later, Kaguya fused with the god-tree and only then did it transform back into the Ten-Tails.
Hamura had TSO without ever being a Ten-Tails jinchūriki. Same goes for Toneri, and even Hagoromo had them before becoming the Ten-Tails’ host. In Naruto The Last, Toneri didn’t need to become a jinchūriki to manifest TSO. All he needed was human Byakugan and Ōtsutsuki chakra not Ten-Tails chakra.
Plus, we know that Momoshiki and Isshiki consumed multiple chakra fruits grown from Ten-Tails god-trees, so them having TSO makes perfect sense.