This was happening because I was calling die() in an API call...which preemptively killed the script. The API didn't set some variables and everything broke. Better not to die() anyways so that stuff actually gets logged.
Turns out ecobee is sometimes changing firstConnected (on four thermostats so far, see #203). Since this field is no longer reliable, switching to serial number (identifier) only.