Welcome to the community, @mutication! The error means there is an if() in the calculation for ${grade} that does not follow the required syntax:
if(expression, then, else) — exactly 3 arguments.
This community post discussed previously should also help you solve on how an if() is used:
Besides, you could also always validate your XLSForm through this online validator to checkout for syntax issues.