I'm struggling since a while with this tricky problem.
I noticed yesterday that my battery was draining really fast and this was usually happening after the sleep period between work and gym then home.
My Mac was switching off the screen instead of sleeping. I cured it by going to System Preferences, then Sharing, and disabling network sharing options there.
NOTE Someone on forums mentioned resetting SMC & PRAM, fixing permissions, and disabling startup applications, but in my case none worked.
From time to time I experienced the same problem in a more transient and evident scenario (fan keeping spinning so the noise tells you that something is wrong with sleeping even if the screen goes black) and here is a way to check it:
that's all for now Alex Barchiesi