Influxdb sensors have dropouts, can't figure out why

I’m having some issues with two influxdb sensors. They work fine, but there are periods of dropouts where there are no updates. I have two sensors of this kind, and the dropouts vary between them. During the dropouts, there is no problem in sending data into influxdb as all other sensors are updated fine during these passages. Any idea why this is happening?

  - platform: influxdb
    host: a0d7b954-influxdb
    port: 8086
    database: homeassistant
    username: !secret influxdb_user
    password: !secret influxdb_pass
    queries:
      - name: 'Kyl (estimated watertemp middle)'
        field: mean_value
        where: '"entity_id" = ''kyl_temperature'' AND time > now() - 4h)'
        group_function: last
        database: homeassistant
        measurement: '(SELECT moving_average("value",12) AS "mean_value" FROM "homeassistant"."autogen"."°C"'
        value_template: '{{ (value | float - 0.9) | round(1) }}'
        unit_of_measurement: °C
      - name: 'Frys (average top shelf)'
        field: mean_value
        where: '"entity_id" = ''frys_2_hogsta_hyllan_temperature'' AND time > now() - 2h)'
        group_function: last
        database: homeassistant
        measurement: '(SELECT moving_average("value",6) AS "mean_value" FROM "homeassistant"."autogen"."°C"'
        value_template: '{{ value | round(1) }}'
        unit_of_measurement: °C