First value of non_negative_derivative() query sometimes very large, bug?

I’m using influxdb 1.8.4 to record metrics of an application that I’ve developed. One of the metrics that is recorded is the number of requests per second of a certain process. This is implemented by periodically outputting the total number of requests processed until that point in time, i.e. a counter that continually increases.
To display this as requests/s in grafana I use an influxQL query like this:

SELECT non_negative_derivative(first("Value")) FROM "MyMeasurement" WHERE ("Instance" = '"XYZ"') and time > now() - 1m GROUP BY time(10s), "Priority" fill(0)

I’ve noticed that sometimes the first value returned by the query is very large, basically the size of the counter at the beginning of the time range.
Likewise if I use derivative() the last sample is sometimes a very large negative number, I guess the negative of the value of the counter at the end of the time range.

e.g.
run query, first value is 7

time                non_negative_derivative
----                -----------------------
1615471630000000000 7
1615471640000000000 44
1615471650000000000 48
1615471660000000000 56
1615471670000000000 54
1615471680000000000 49
1615471690000000000 49

run same query a second or two later, now the first sample is 24935.

time                non_negative_derivative
----                -----------------------
1615471630000000000 24935
1615471640000000000 44
1615471650000000000 48
1615471660000000000 56
1615471670000000000 54
1615471680000000000 49
1615471690000000000 49

Has anyone else experienced this? it seems like a bug but I have searched and didn’t find anything like this.

Update: I ‘fixed’ it by using fill(previous). Still doesn’t seem right that a sample would change from one run of a query to the next.