Are there any monsters or items that can trap a person in a time loop?


I’m working on a D&D campaign where a town is stuck in a time loop. my players can do whatever and the day doesn’t repeat exactly; every day is a different day, the sun revolves around the planet and monday ends and tuesday begins, but the townsfolk are stuck doing the exact things they did the day they were cursed and are trapped repeating what they did over and over until the curse/enchantment/spell is broken. The townspeople are unable to interact with the players.

I’m straying from my point heavily but are there any monsters or items that could trap a person in a time loop?