Hey!
So, maybe the IT requires a user of the Rinnegan to sacrifice himself in order to cancel it? Maybe Hagoromo intended to do so, but Hamura somehow gave him his chakra to keep him alive and died himself.
Now, Sasuke will be ready to sacrifice himself, but Madara intereferes and stops IT...