How to turn on and off LED when ESP32 board reach specific internal temperature threshold?
You initialise was_overheated to false every time at at the start of myTimerEvent(), and only set the RELAY_PIN to HIGH if was_overheated is true, without changing was_overheated inbetween.
Declaring was_overheated as a global variable and initialising it once should help, or making it static. As it is now, it is being set to false every time myTimerEvent() is called.