Problems with trend sensor - works perfectly sometimes, not a all later

To display indicator icons at the temperature values I created trend sensors, that seem to work properly most of the time but the sometimes just “fail”. Any idea what could be the issue? The sensor “schlafzimmer_temperatur_faellt” should definitely be off shortly after 10 o’clock…

template:
  - platform: trend
      schlafzimmer_temperatur_steigt:
        entity_id: sensor.schlafzimmer_thermostat_kanal_2_temperatur
        sample_duration: 600
        max_samples: 5
        min_samples: 2
        min_gradient: 0.00001
  
      schlafzimmer_temperatur_faellt:
        entity_id: sensor.schlafzimmer_thermostat_kanal_2_temperatur
        sample_duration: 600
        max_samples: 5
        min_samples: 2
        min_gradient: -0.00001

Is it possible that there are too few samples coming in during the sample period? But still, that does not really explain the issue for me.

I think I found an explanation:

If the temperature rises too slow, all steps have a larger distance than “sample_duration”.

Maybe I should switch to the derivative sensor, or change the sample duration.

I think the trend sensor with the current implementation is not very helpful.