Why does this rule give a error?

Note also that you have no way out of your repeat, so it will keep going indefinitely (it might not really do anything if you have all the actions inside contained within a conditional action, but I suspect you just don't want it scheduled at all unless needed).

For various examples of repeats, I often refer people to this thread. The goal here is notifications, but that doesn't really matter--the important thing is how to get the repeat (and what stops it). In Rule 5.1, you have a few more options, notably "Repeat while (expession)," that might make this a bit easier, but the "old" ways will still work: