History Stats not counting from 00:00 for daily totals

I am using the history stats to give me a daily total of how long a switch has been open.
There seems to be a new issue in one of the recient updates which is causing the daily total to be incorrect.
The code I am using for the sensor is:

- platform: history_stats
  name: Back Door Open Today
  entity_id: binary_sensor.backdoor_contact
  state: 'on'
  type: time
  start: '{{ now().replace(hour=0, minute=0, second=0) }}'
  end: '{{ now() }}'

The screen shot shows that the sensor is has been open for 11:43:12 but this is incorect.

The recoder is set to record the sensor.

Has anyone else had issues with the history stats showing incorrect time usage?

What version of home assistant are you running?

https://community.home-assistant.io/t/strange-history-statistics/433815/2

It is on 2022.06.00, I will update to the latest version and see if this fixes it

Updated to the latest version and its still counting from the time the sensor is first triggered rather than counting the time from zero.