It seems that there is a difference between eval command and eval expression:
Eval command:
eval velocity=distance/time
Eval expression:
stats count(eval(status=404)) AS status_count
Notice that in the case of the expression eval is used as a function with parentheses around the arguments. I found documentation for the eval command: https://docs.splunk.com/Documentation/Splunk/8.2.3/SearchReference/Eval
Is there documentation for the eval expression?