Statistics card shows same value for yesterday and today?

I wanted to display two energy usage values in my dashboard, one for today, other for yesterday. I figured using the statistic card was the right one for the job, allowing me to select “Today” and “Yesterday” in the card config. However, both of the cards show identical value - I think because the value is reset to zero a few milliseconds after 00:00:00?

My chain is:
Shelly energy entity (one for each 3 phases) >> Utility Meter (for each phase) >> Min/Max helper (Sum) >> Statistic cards (today & yesterday)

My guess is that the Min/max helper is to blame, and I should revise my chain by swapping the middle parts around? Or is there something else I could do?

Two statistic cards, one configured for Today, other for Yesterday:

- type: statistic
period:
calendar:
period: day
stat_type: max
entity: sensor.energy_day
name: kWh Today

- type: statistic
period:
calendar:
period: day
offset: -1
stat_type: max
entity: sensor.energy_day
name: kWh Yesterday

Both cards display exactly the same value even though they shouldn’t:
image

History graph of the entity sensor.energy_day. Does go to zero at ~00:00, as intended:
image

Min/max helper set to calculate Sum of three Utility Meters:
image

Each of those Utility Meter entities have the following attributes:

state_class: total_increasing
source: sensor.shellyem3_channel_a_energy
status: collecting
last_period: '63.8496'
meter_period: daily
cron pattern: 0 0 * * *
last_reset: '2023-03-07T22:00:00.012301+00:00'
unit_of_measurement: kWh
device_class: energy
icon: mdi:sigma
friendly_name: L1 day kwh