i found a glitch in task 1 or im just stupid

basically sometimes the flash works and sometimes it does not (but it still drains the power bar) am i doing it wrong?