I think there are two main problems, one story-wise, one players-wise.
Regarding the story-problem: In this kind of story, you most likely have a fixed start and a fixed end. This is easy to write, but in my expectation not so easy to play, since to really get the feeling of a loop, the players have to fail (escaping) at least two, better three or more times. Given how creative players are (and we absolutely do want them to be this way!) this definetly blurs the line towards railroading and will not easy to convey it happening ‘naturally’.
Which leads to the players-problem: You have to balance the needs of the story (players failing at least two times) with the players empowerment (being creative and finding loopholes – pun intended), i.e. the danger that the players might be frustrated because they cannot change the game anymore, and the fact that you have ‘infinite’ repetition, i.e. the danger that the players might be bored.
My advice would be to work with limited time and gradual progression.
So, the players only have a limited time within the loop, until it starts all over again. With each iteration, they should get more information and more tiles of your puzzle. Thus, they still have the feeling about changing the game but it’s just a race against time, not against a arbitrary GM. Also, since they should always manage to make at least one further step within each iteration of the loop, they don’t get bored.
Consider watching DC’s ‘Legends of Tomorrow’ 3x11 ‘Here I go again’ for examplary use of this trope.
You also should think about facilitating ‘standard procedures’, representing the characters getting used to solving a specific problem because its literally the same problem every time (‘Ned Ryerson?’ – ‘Bing!’). I, personally would consider giving every check they already succeeded in a prior iteration a difficulty of 0. Thus, the players can choose to speed up the game just telling they did a step or two they solved in-depth in a prior iteration of the loop, or to actually do the check and generate momentum (representing growing more and more accostumed to the problem).
This, of course, is explained a lot easier if the characters are aware of the loop, too, and not only the players.
In my opinion, time loops are some of the harder parts of GMing, I imagine it very difficult to do it well. So, good luck – and maybe tell us how you did it!