In the screenshot above the ‘target_obj’ is really incorrect, because it should be only ‘target’. But just tried in SquareLine Studio, now it exports ‘target’ and behaves correctly (Button2 has a checked and unchecked events that set Button1 to the corresponding states.)
The event must not have ‘ui_Button2’ in the lv_obj_has_state() evaluation because ‘target’ is the same as ui_Button2 there, thanks to LVGL setting it in the ‘event’ object received by the callback.