Hi there! What version of Moodle are you using?
In this case, you should look for a more elegant solution than using a grade calculation. I'd recommend enabling "grade to pass" on each of the Quizzes, which marks a grade with either a checkmark or an X symbol based on the grade scored and whether it's above or below the "grade to pass" set on the Quiz. This bypasses you having to do a calculation, and you can set "grade to pass" as a value in the Quiz settings when making them.
Here's an image of what this looks like in our theme:
You can also then view this for users in the Grader Report, as well:
This seems to be a much cleaner way to do what you're looking to do.