Also, do you already have any calculated fields in your BAQ?
I’ve seen cases where, even though a BAQ will pass all the syntax checks
it may still throw similar errors intermittently when a record with a null value is encountered. Why I’ve gotten in the habit of handing nulls and zeros in calculated fields.
e.g. for a numrtoc calc field, I might do something like this
(case
when ISNULL(num01,0) > 0
AND ISNULL(num02,0) > 0
then (num01 / num02)
else 0
end)