I came across this issue recently but I couldn't figure out what was causing it. After simply reinstalling windows the issue went away but it came back after reinstalling Bandicam.
What I have found out is that Bandicam is keeping an audio stream open all the time regardless if it is being used or not. Meaning that while I am NOT recording and Bandicam is idle, it keeps an audio stream open preventing Windows from sleeping.
I am using:
Windows 10 Home x64
Sound Blaster Z
16 GB RAM
Also tested this to make sure its actually Bandicam causing the problem and yes the PC will sleep if i exit Bandicam.