The error indeed can be a bit confusing, as you didn't really wrote a recursion...But you use CTE and that's actually a kind of recursion (or at least it is implemented that way).
If not defined otherwise a simple CTE can have up to 100 records only...
Use MAXRECURSION to set it larger or infinite (0)...
WITH common_table_expression (Transact-SQL)[
^]