Two lines that look the same, produce different results. The first lines gives an error message, but the next line that looks the same, does not.
copying and pasting both lines in Notepad reveals the difference:
Determinant*(R1 . B+R2 . B+R3 . B+R4 . A)
Determinant(R1 . B+R2 . B+R3 . B+R4 . A)
It seems that there is a hidden character (the asterisk) in the first line that produces the error.
In the worksheet itself you cannot see the asterisk, but using the arrow keys you can notice that there is another character.
It's hard to debug your code if there are hidden characters.