Unable to change mode of Honeywell Lyric Thermostat from SmartApp

Whenever I try to change the mode of Honeywell Lyrics Thermostat via setThermostatMode command, it gives the following error in the logs:

[debug]: generateSetpointEvent() >> mode: heat, thermostatSetpoint: 70
[error]: Error setting new mode and the method returned: false
[debug]: Lyric >> changing to mode cool, heatingSetpoint to 70 F (21.0 C) coolingSetpoint to 75 F (24.0 C)
[debug]: changing mode to cool for deviceId: TCC-1691346 from parent using body: {“mode”: “Cool”, “autoChangeoverActive”: false, “heatSetpoint”:21.0, “coolSetpoint”: 24.0, “emergencyHeatActive”: false}

Can anybody tell me what I am doing wrong ?

Looking at the code this happens when the API call fails. Might need to re-initialize the thermostat through the connect app.