They screwed it up. Kishi already had her backstory set with the Databook. She arrived to Earth with her clan to take the fruit. She merged with the God Tree and then became the Ten Tails. Hagoromo and Hamura fought the Ten Tails without realizing that it was their mother. They did not fight Kaguya herself.
They messed a few other things up like Indra's MS somehow being the exact same as Sasuke's (they probably forgot that Madara was a transmigrant as well with a different design). The spiral design is classified as his MS somewhere but I forgot if it was in the Databook or somewhere else.
They messed up her past and it looks like he had no choice but to retcon her original past in the Boruto series. I know Kishi isn't in charge of Boruto but apparently he's now involved in it.
^^^Pretty much this.
Though to be fair, Kishi himself did make some things pertaining to Kaguya very confusing and even contradictory to itself even in the manga.
For instance:
Hagoromo directly said that he and his brother fought the juubi and then sealed it inside of himself, thus making Hagoromo the juubi jinchuuriki. However, Kaguya's flashback at the end of team 7's fight with her seemed to depict Hagoromo and Hamura sealing her inside of the moon via rikudou chibaku tensei. Black Zetsu also said that at the end of their fight, Hagoromo and Hamura turned the juubi into the core of the chibaku tensei and sealed it inside of the moon at the end of their fight. Now if we ignore the anime and assume that Hagoromo and Hamura only fought the juubi (and not the team of the juubi and Kaguya separately like what the anime depicted), then when would Hagoromo have become the juubi jinchuuriki if he and Hamura just immediately used rikudou chibaku tensei and sealed the juubi inside of the moon at the end of their fight? In fact, why would Hagoromo even become the jinchuuriki in the first place if they could just seal the thing in the moon then and there?
But wait...
If Hagoromo and Hamura just immediately sealed the juubi in the moon at the end of their fight, then where would the bijuus have come from? Also, what about the mazou?
Do you see what I mean?
But then there are even more contradictions:
Another example: The Last and its associated guide book Retsu no Sho say that after the fight with the juubi, Hamura took leadership of the Otsutsuki clan and went up to the moon to guard the mazou. Ok, well this would imply that there should have been other Otsutsukis on Earth during Kaguya's era, but the anime and manga both seem to imply that Kaguya came alone. In fact, even the Boruto series implies this too.
Then, what about the Hyuuga clan? If Hamura just went to the moon immediately after fighting the juubi, then when did he hook up with some Earthling woman and start what would become the Hyuuga clan?
I really do enjoy the story of the Otsutsuki and the lore of it, but it really could have been done better and made less confusing and more consistent.