Issue creating a time series plot grouping on month and year

I am using the following query to create a time series plot

SELECT
$__timeGroup(DischargeDate, ‘1M’) as time,
AVG(Los) AS Average_LOS
FROM
$hospital_table.ca_prediction_stats AS stats
WHERE
$__timeFilter(DischargeDate)
GROUP BY
1
ORDER BY
1;

It appears that the __timeGroup function is grouping in an unusual fashion. For example, when I hoover over the first data point in the dataset it says “2022-10-19 19:00:00”, the second point shows “2022-11-17 18:00:00”, third point “2022-12-16 18:00:00” etc. Ideally the points would be tied to the first day of the month and include the Average_LOS among all rows where DischargeDate falls within a specific YYYY-MM.

FYI, the earliest value of DischargeDate in the table is ‘2022-11-01 00:10:00’, not sure why the first point shows 2022-10-19 19:00:00.

Thanks in advance!