Inconsistent Error plotting Derivative

I’ve run into a problem which I’m not sure how to deal with. Everything was operating correctly until I changed the derivative unit to 1s.

import “math”

from(bucket: “test2”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == “logging”)
|> filter(fn: (r) => r["_field"] == “Pressure”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “raw”)
|> timedMovingAverage(every: 5s, period: 10s)
|> yield(name: “mean”)
|> derivative(unit: 1m, nonNegative: false)
|> yield(name: “derivative”)


I got this error message:

I tried reverting my dashboard back and I now continually keep getting the error. Not sure how to correct it. Grafana plots raw and mean, but gets an error on the derivative. It is is inconsistent though. I can zoom out and it will sometime work. But then as I zoom in it will randomly not work.

Any suggestions how to correct it?