FYI: Your code can be simplified. Since the Apex evaluates each line of code from top to bottom, and the last one that's True sets the output state, you can remove the 2nd If Time command because the initial Set OFF handles the condition outside of the 1st If Time range:
Fallback OFF
Set OFF
If Time 00:00 to 12:00 Then ON
Basically, the Apex sees that when outside the 00:00 - 12:00 time range the only valid condition in the list is Set OFF, so it turns it off during the remaining hours.
See my series of Apex tutorials for more tips and programming examples:
https://www.reef2reef.com/ams/authors/suncrestreef.93940/