Template entity shows the wrong value

Hi, I have created the following template, and sometimes the sensor shows a different value (100%) than the graph below (65%). It doesn’t happen every time, but sometimes it shows 100% instead of the correct value.
Thanks

  - platform: template
    sensors:
      self_consumption_solar_battery_devide_load_consumption_monthly:
        friendly_name: "Podíl vlastní výroby na spotřebu - měsíční"
        icon_template: mdi:home-lightning-bolt-outline
        value_template: "{{ ( states('sensor.spotreba_z_vlastni_vyroby_mesicni_new') | float / states('sensor.spotreba_energie_mesicni_new') | float * 100) | round(1) }}"
        unit_of_measurement: '%'

That’s a problem with the history chart that pops up on the quick view.

Any idea how to solve it? The entity state is dislayed everywhere like “100%”.

Does anyone have any idea how to solve this issue? It’s behaving very strangely. There are several similar sensors that represent the same ratio of two entities and display correctly on cards without any problems. However, this behavior occurs only with some of them and on various types of cards (entities or custom).

I even discovered that when viewing the same card and entities from a different device - like an Android phone instead of a browser on Windows - the values display correctly.

I tried creating an entirely identical sensor, calculated from the same entities but with a different name, and even then, it displays differently (on Windows).

image

Creating a new sensor didn’t help and caused the same issues. I have no idea how to solve this anymore. It’s clearly just a display issue; the sensor data is fine.