I had HA in debug logging mode for a few days to try and capture one of these errors but as Murphy would have it nothing happened and debug logging was thrashing my SD card so I had to reduce the logging level.
To work around this problem I am going to add a template condition to all my automations that change input selects to ensure the option is valid.
e.g.
- id: logging_level
alias: 'Logging Level'
initial_state: true
hide_entity: true
trigger:
platform: state
entity_id: input_select.logging_level
condition:
- condition: template
value_template: "{{trigger.to_state.state in ['error', 'warning', 'info', 'debug'] }}"
action:
service: logger.set_default_level
data_template:
level: "{{ trigger.to_state.state }}"