Simple automation but not stable

Hi,

I have a simple automation which has to play a message on a speaker when a binairy switch is "on’ or “off”. Sometimes it works fine but sometimes the tekst isn’t audible.

When I look in the trace timeline, I see the automation has run but I don’t hear anything from the speaker.

Anybody an idea what I can check to get it work properly?

description: ""
trigger:
  - type: not_opened
    platform: device
    device_id: e74e39efd80eba2ab1bd7f0db2771bfd
    entity_id: binary_sensor.contact_sensor_4
    domain: binary_sensor
condition: []
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.luna
    data:
      media_content_id: >-
        media-source://tts/cloud?message=Je+raam+is+dicht+dus+je+verwarming+of+airconditioning+kunnen+eventueel+aan.&language=nl-NL&gender=female
      media_content_type: provider
    metadata:
      title: >-
        Je raam is dicht dus je verwarming of airconditioning kunnen eventueel
        aan.
      thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
      media_class: app
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://tts
        - media_content_type: provider
          media_content_id: >-
            media-source://tts/cloud?message=Je+raam+is+dicht+dus+je+verwarming+of+airconditioning+kunnen+eventueel+aan.&language=nl-NL&gender=female
mode: single