"SetAttr CLEARATTR=R @filesonly" results in unknown error

I think this shouldn't happen:

clearattr

works without @filesonly of course.

Tested with DO 12.9.2

Modifiers need to be on their own line. As it is you're telling the SetAttr command to change the attributes of a file called @filesonly.