Sometimes Stat blows up when creating custom queries, but it is not consistent. The issue is not reproducible. This could happen both when creating a custom CSR Query as well as custom Task Query. The error message is:
Alert! An Error has occurred. Please contact your administrator or check your Agent Log for details.
The server.log from the Central Agent doesn't show anything.