Toggle visibility of another layer via conditional logic

I’m trying to toggle the visibility of a layer in my prototype.

User unchecks checkbox, line in chart hides.
User checks checkbox, line in chart shows.

Achieved this using conditional logic & variables (see screenshot), but the interaction only works every 2 clicks, I swear this worked before the update to UI3.