Can the Macbook be woke while closed? I set a schedule wakeup in the energy preferences. It doesn't seem to wake up. Is the Macbook capable of waking up, turning on wifi and then running cron jobs while shut?
I don't think so. Why do you need to awake your MacBook while the lid is closed? And why do you need to close the lid at all if you aren't transporting it anywhere outside your room? Leave the lid open if you aren't in moving. And your problem is solved.

You will get more from this link: https://discussions.apple.com/thread/2208013?tstart=0

Hope this helps ☺️