Hi @Mike_Clarke,
I haven't tested your expression, but at first glance, it seems that the if function might be used incorrectly. In expressions it is possible to omit the default parameter name and immediately write the value, this is what you are doing in the if function, but it seems you are providing the default parameter twice.
{var "errorPct"} {gt 0.3}
Would it solve your problem if you provided a single default parameter, something like this:
if {var "errorPct" | gt 0.3} then="red" else="green"
or
if condition={var "errorPct" | gt 0.3} then="red" else="green"