Error 500 when i create a automations and scripts with !secret data

When I create an automation through UI and I use in event_data !secret password from secrets.yaml I get an error (Error loading automation (500).)

....
trigger:
  - platform: event
    event_type: tag_scanned
    context:
      user_id:
      - 1a344534dcaer43de58d3f8e6be40b6asd
    event_data:
      device_id: !secret nfc_smartphone_id_1
      tag_id: !secret nfc_tag_light_1
....

Automation works, but when I try to edit any script I get “Error loading automation (500)”

The same when I use it inside a script with for example the service alarm_control_panel.alarm_disarm

disarm_with_tag_nfc:
  alias: Disarm
  sequence:
  - service: alarm_control_panel.alarm_disarm
    data:
      code: !secret alarm_pin_code
    target:
      entity_id: alarm_control_panel.alarm_house
  mode: single
  icon: mdi:lock-open

it doesn’t open the scripts UI anymore

Has this happened to anyone?
Do you have any idea?
Thank you very much for your help
N.

I have observed this issue as well. Using !include /file_pathway to expand a script with a separate YAML file causes Response Error 500 when trying to save a new script created via the User Interface. I must edit the Script.yaml file such that the include is not seen ("!include /file_pathway") temporarily, create my script, then I can again make it seen (remove " "). If you have since figured out how to avoid this phenomenon, please let me know.

Just discovered this. I had a script with !secret and would get an error 500 when trying to create a new script via UI. I delete the !secret and the UI works now.

Cheers,