Sounds like you may have a fairly common reason for budding plants to show male flowers,and that is Light Leaks.

You need to look at your room for any light getting out when it's running.Because if it can get out from your room with the lights on,then it can get into your room when the lights are off.

Having light leaks when the plants are in thier night cycle will cause them to Hermie on you.