Nest return to previous state after going to ECO

I have been using the below to set my Nest to ECO and return to its previous state for years. But something has caused it to stop working and I can’t figure it out. Any help would be great.
sensor:

- platform: template
  sensors:
     downstairs_thermostat_hvac_mode:
         value_template: >
            {% if is_state_attr('climate.downstairs', 'preset_mode', 'eco') %}
             eco
            {% else %}
                 {{ states('climate.downstairs') }}
            {% endif %}

script:

nest_eco_on:
      alias: Nest Thermostat - Set to ECO mode
      sequence:
          # Only turn on ECO mode if thermostat is not off and not already in ECO
          # mode.
          - condition: template
            value_template: >
                {{ states('sensor.downstairs_thermostat_operation_mode')
                    not in ['off', 'eco'] }}

           - service: input_text.set_value
              entity_id: input_text.previous_hvac_mode
              data_template:
              value: "{{ states('sensor.downstairs_thermostat_operation_mode') }}"

           - service: climate.set_preset_mode
             entity_id: climate.downstairs
            data:
               preset_mode: eco

nest_eco_off:
       alias: Nest Thermostat - Return from ECO mode
       sequence:
           # Only set back to previous mode if thermostat is still in ECO mode.
           - condition: template
              value_template: >
                  {{ is_state('sensor.downstairs_thermostat_operation_mode', 'eco') }}

          - service: climate.set_hvac_mode
            entity_id: climate.downstairs
            data_template:
                hvac_mode: "{{ states('input_text.previous_hvac_mode') }}"

I just noticed the same problem as well. However I change the Preset Mode to Eco, it doesn’t seem to be accepted by Google. I’ve tried some simple scripts, and using the thermostat card.

Oddly, using the Nest app, I can set Eco mode, and then use Home Assistant to set it back to “none”. It’s just just the switch to enable Eco that seems broken. (HA does properly track the status of Eco Mode.)

My Nest thermostats are older 2nd gen. They don’t expose the “away_mode” attribute, so this is the only method I have to mimic the home/away behavior.