Kaguya is a nice fresh new face. When the manga hasn't moved anyway and the location has stayed the same for a whole year, it gets stale very quickly. Bringing in a new villain character was a perfect way to pick things up again. Not everything is going to be foreshadowed, somethings are just going to happen out of nowhere, that is just regular storytelling.
Foreshadowing involves placing hints that something will happen before it does in the story.Kaguya's return was foreshadowed when Madara absorbed the Shinju,BZ being her will was foreshadowed because he was placed on a zetsu that was created from the Gedo Mazou.
BZ being Kaguya's "son" and the mastermind behind everything was not.That isn't regular story telling,on the contrary it's called a Shocking Swerve.
"The shocking swerve is a kind of twist made just to have a twist. There's little-to-no rhyme or reason involved, no foreshadowing, and no way that the viewer could have ever seen it coming. They just pulled it out of nowhere due to a possibly misguided desire to "shock" the viewer. Characters may be derailed, subplots may be ruined, and generally everything that's occurred so far may be thrown out the window, just to pull off this twist."