It doesn't matter because it's filler. He had Rinnegan before sealing Kaguya in the manga that's all we know.
Sooo the anime will be canon if hagaromo has the rinnegan before sealing kaguya. The anime is canon bro its kinda like canon/filler but its much needed idk why ppl are complaining they wanted backstory of hagaromo and hamura and kaguya so stfu and enjoy the show.