Timeline aside. The wall of Kegare outside  the shrine is a reason to expect trouble. Think of it like chasing some bandits out of a castle/fortress only to see them run out the gates into a vast mob of bandits right outside. You know the Kegare will strike back.