How do I stop the light sprite from disappearing

How do I…

The directional light is a sprite on lighting layer and disappears at certain angles.

What is the expected result

The directional light should rotate toward cursor.

What is the actual result

It rotates toward cursor, but disappears sometimes

Related screenshots

aa

The rotation code is