The answer of muzimuzhi Z shows what you should do to avoid the error (and you should probably accept that one) but your actual question asks why it loops rather than how to avoid the error.
The looping isn't really related to xparse other than looking for an optional argument is not allowed before
\rowcolor or similar special table cell commands) If any non-expandable material is seen the cell template starts and it is too late to insert the non-aligned material for the rule.
So a simpler example of the loop is
1 & 2 & 3 \\
4 & 5 & 6 \\
As in your example this stops with several essentially spurious error messages but if you scroll past them you eventually hit a tight loop and will have to kill the program,
\tracingall will show:
Which shows that essentially you have hit this well known loop condition:
Which makes TeX run forever with no error.
\hrule, which makes a horizontal line across the page is only allowed between paragraphs, in vertical mode. If it is encountered in horizontal mode TeX does not raise an error it inserts
\par to end the current paragraph before the
\hrule token then proceeds as normal.
The thing to note is that unlike the similar situation of a vertical box ending in horizontal mode, TeX does not execute the primitive end-paragraph code, it literally inserts the token
\par into the input stream.
So if as here (and for technical reasons in latex tabular)
\par is locally defined to do nothing then
\hrule triggers insertion of
\par which does nothing, then the
\hrule is seen again, which inserts