Cloudwatch alert rule issue

We are using Cloudwatch datasource in Grafana and configured alerts using following expression

filter @message like ‘error’ or message like ‘400’
|stats count(*) as exceptionCount by bin(1h)
|sort exceptionCount desc

When there is no data, we are getting below error and it is firing notifications with datasource error. When data is there alert works as expected

“input data must be a wide series but got type not (input refid)”

Please suggest if you are aware of this issue and possible fix