Dashboard query returns inaccurate results

Hi,
I have a panel with a query that returns time series data, using Zabbix as data source.
I use the same query in other panels, where the goal is to show the max value of the time series, by selecting - Dashboard - as the data source, and selecting the query.

The graph and numbers delivered from the source query looks correct, but the numbers from the dashboard query fluctuates, even though the max hasn’t change.

Looking at the queries, the query for the source dashboard looks fine:
rawSql:“SELECT CAST(itemid AS CHAR) AS metric, MIN(clock) AS time_sec, AVG(value) AS value FROM history_uint WHERE itemid IN (292377, 292364, 292365) AND clock > 1618295409 AND clock < 1618468209 GROUP BY (clock-1618295409) DIV 60, metric ORDER BY time_sec ASC”

While the query from the dashboard query looks incorrect:
rawSql:“SELECT CAST(itemid AS CHAR) AS metric, MIN(clock) AS time_sec, AVG(value) AS value FROM history_uint WHERE itemid IN (292377, 292364, 292365) AND clock > 1617228000 AND clock < 1618468024 GROUP BY (clock-1617228000) DIV 599.9148524431544, metric ORDER BY time_sec ASC”

Note the DIV for the last query.
Any idea why that happens, and how I can correct it?